Spaces:
Runtime error
Runtime error
Commit
·
fd1fdb1
1
Parent(s):
8149bdd
final commit
Browse files- Dockerfile +3 -2
- app.py +1 -1
Dockerfile
CHANGED
@@ -4,6 +4,7 @@ FROM python:3.10
|
|
4 |
WORKDIR /code
|
5 |
|
6 |
ENV FLASK_APP=app.py
|
|
|
7 |
|
8 |
# Copy the current directory contents into the container at /code
|
9 |
COPY ./requirements.txt /code/requirements.txt
|
@@ -24,5 +25,5 @@ WORKDIR $HOME/app
|
|
24 |
|
25 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
26 |
COPY --chown=user . $HOME/app
|
27 |
-
|
28 |
-
CMD ["flask", "run"
|
|
|
4 |
WORKDIR /code
|
5 |
|
6 |
ENV FLASK_APP=app.py
|
7 |
+
ENV FLASK_RUN_HOST=0.0.0.0
|
8 |
|
9 |
# Copy the current directory contents into the container at /code
|
10 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
25 |
|
26 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
27 |
COPY --chown=user . $HOME/app
|
28 |
+
EXPOSE 7860
|
29 |
+
CMD ["flask", "run"]
|
app.py
CHANGED
@@ -49,7 +49,7 @@ warnings.filterwarnings('ignore')
|
|
49 |
def inference(image_prompt, image):
|
50 |
prompt = f"USER: <image>\n{image_prompt} ASSISTANT:"
|
51 |
inputs = processor(text=prompt, images=image, return_tensors="pt")
|
52 |
-
generate_ids = base_model.generate(**inputs, max_new_tokens=
|
53 |
decoded_response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
54 |
|
55 |
# prompt = "USER: <image>\nWhat's the content of the image? ASSISTANT:"
|
|
|
49 |
def inference(image_prompt, image):
|
50 |
prompt = f"USER: <image>\n{image_prompt} ASSISTANT:"
|
51 |
inputs = processor(text=prompt, images=image, return_tensors="pt")
|
52 |
+
generate_ids = base_model.generate(**inputs, max_new_tokens=1024)
|
53 |
decoded_response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
54 |
|
55 |
# prompt = "USER: <image>\nWhat's the content of the image? ASSISTANT:"
|