Spaces:
Running
Running
Commit
·
b6c265e
1
Parent(s):
6afa43e
Default Agent
Browse files- Dockerfile +6 -2
- main.py +3 -0
Dockerfile
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
|
4 |
FROM python:3.10
|
5 |
|
|
|
|
|
|
|
|
|
6 |
# Create a directory for the app
|
7 |
WORKDIR /app
|
8 |
|
@@ -15,10 +19,10 @@ RUN wget -O DeepSeek-R1-Distill-Qwen-1.5B-Q2_K.gguf \
|
|
15 |
|
16 |
|
17 |
# Copy the files to the container
|
18 |
-
COPY . /app
|
19 |
|
20 |
# Install the requirements
|
21 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
# Expose the port
|
24 |
EXPOSE 8000
|
|
|
3 |
|
4 |
FROM python:3.10
|
5 |
|
6 |
+
RUN useradd -m -u 1000 user
|
7 |
+
USER user
|
8 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
9 |
+
|
10 |
# Create a directory for the app
|
11 |
WORKDIR /app
|
12 |
|
|
|
19 |
|
20 |
|
21 |
# Copy the files to the container
|
22 |
+
COPY --chown=user . /app
|
23 |
|
24 |
# Install the requirements
|
25 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
26 |
|
27 |
# Expose the port
|
28 |
EXPOSE 8000
|
main.py
CHANGED
@@ -183,6 +183,7 @@ async def async_generator_from_sync(sync_gen_func, *args, **kwargs):
|
|
183 |
loop.call_soon_threadsafe(q.put_nowait, None)
|
184 |
|
185 |
with concurrent.futures.ThreadPoolExecutor() as executor:
|
|
|
186 |
executor.submit(producer)
|
187 |
while True:
|
188 |
item = await q.get()
|
@@ -225,7 +226,9 @@ async def run_research_forever():
|
|
225 |
full_response = ""
|
226 |
try:
|
227 |
# Generate the model response and accumulate the full text.
|
|
|
228 |
async for token in generate_response_background(conversation):
|
|
|
229 |
token_text = token["choices"][0]["delta"].get("content", "")
|
230 |
full_response += token_text
|
231 |
# Log each token individually
|
|
|
183 |
loop.call_soon_threadsafe(q.put_nowait, None)
|
184 |
|
185 |
with concurrent.futures.ThreadPoolExecutor() as executor:
|
186 |
+
logging.info("Inside executor")
|
187 |
executor.submit(producer)
|
188 |
while True:
|
189 |
item = await q.get()
|
|
|
226 |
full_response = ""
|
227 |
try:
|
228 |
# Generate the model response and accumulate the full text.
|
229 |
+
logging.info["Before generate_response_background"]
|
230 |
async for token in generate_response_background(conversation):
|
231 |
+
logging.info (f"generate_response_background yields: {token}")
|
232 |
token_text = token["choices"][0]["delta"].get("content", "")
|
233 |
full_response += token_text
|
234 |
# Log each token individually
|