Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- Dockerfile +3 -3
- app.py +3 -2
- requirements.txt +1 -1
Dockerfile
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
FROM python:3.9
|
2 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
3 |
RUN useradd -m -u 1000 user
|
4 |
-
COPY ./startollama.sh startollama.sh
|
5 |
-
RUN chmod +x startollama.sh
|
6 |
-
RUN /bin/sh startollama.sh
|
7 |
#RUN /usr/local/bin/ollama serve & sleep 5 && ollama pull llava-llama3 && exit
|
8 |
#RUN ollama list
|
9 |
|
|
|
1 |
FROM python:3.9
|
2 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
3 |
RUN useradd -m -u 1000 user
|
4 |
+
#COPY ./startollama.sh startollama.sh
|
5 |
+
#RUN chmod +x startollama.sh
|
6 |
+
#RUN /bin/sh startollama.sh
|
7 |
#RUN /usr/local/bin/ollama serve & sleep 5 && ollama pull llava-llama3 && exit
|
8 |
#RUN ollama list
|
9 |
|
app.py
CHANGED
@@ -15,7 +15,7 @@ from langchain.callbacks import StdOutCallbackHandler
|
|
15 |
from transformers import pipeline, TextIteratorStreamer, AutoTokenizer, AutoModel, AutoModelForCausalLM
|
16 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
17 |
from huggingface_hub import login
|
18 |
-
|
19 |
from threading import Thread
|
20 |
from typing import Any, List
|
21 |
import ast, torch
|
@@ -91,7 +91,8 @@ user_prompt = ChatPromptTemplate.from_messages(
|
|
91 |
("human", "{input}"),
|
92 |
]
|
93 |
)
|
94 |
-
|
|
|
95 |
##################for File Ingestion
|
96 |
def remove_ansi_escape_sequences(input_string):
|
97 |
# Define a regular expression pattern to match ANSI escape sequences
|
|
|
15 |
from transformers import pipeline, TextIteratorStreamer, AutoTokenizer, AutoModel, AutoModelForCausalLM
|
16 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
17 |
from huggingface_hub import login
|
18 |
+
import ollama
|
19 |
from threading import Thread
|
20 |
from typing import Any, List
|
21 |
import ast, torch
|
|
|
91 |
("human", "{input}"),
|
92 |
]
|
93 |
)
|
94 |
+
ollama.pull("llava-llama3")
|
95 |
+
ollama.list()
|
96 |
##################for File Ingestion
|
97 |
def remove_ansi_escape_sequences(input_string):
|
98 |
# Define a regular expression pattern to match ANSI escape sequences
|
requirements.txt
CHANGED
@@ -17,4 +17,4 @@ sentence_transformers
|
|
17 |
huggingface_hub
|
18 |
langchain_huggingface
|
19 |
rapidocr-onnxruntime
|
20 |
-
|
|
|
17 |
huggingface_hub
|
18 |
langchain_huggingface
|
19 |
rapidocr-onnxruntime
|
20 |
+
ollama
|