Spaces:
Configuration error
Configuration error
DoctorSlimm
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
31 |
|
32 |
|
33 |
|
34 |
-
text_only_template = """
|
35 |
-
The assistant gives helpful, detailed, and polite answers to the user's questions. \
|
36 |
-
USER: {} ASSISTANT:"""
|
37 |
|
38 |
|
39 |
@spaces.GPU
|
@@ -44,7 +42,7 @@ def generate_caption(image, prompt):
|
|
44 |
|
45 |
# image = Image.open(image_path).convert('RGB')
|
46 |
image = image.convert('RGB')
|
47 |
-
query =
|
48 |
input_by_model = model.build_conversation_input_ids(
|
49 |
tokenizer,
|
50 |
query=query,
|
|
|
31 |
|
32 |
|
33 |
|
34 |
+
text_only_template = """USER: {} ASSISTANT:"""
|
|
|
|
|
35 |
|
36 |
|
37 |
@spaces.GPU
|
|
|
42 |
|
43 |
# image = Image.open(image_path).convert('RGB')
|
44 |
image = image.convert('RGB')
|
45 |
+
query = "USER: %s ASSISTANT:" % prompt
|
46 |
input_by_model = model.build_conversation_input_ids(
|
47 |
tokenizer,
|
48 |
query=query,
|