Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,13 +19,12 @@ def generate(prompt, system_prompt, max_new_tokens):
|
|
| 19 |
seed=42,
|
| 20 |
)
|
| 21 |
|
| 22 |
-
formatted_prompt = f"
|
| 23 |
-
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 24 |
output = ""
|
| 25 |
|
| 26 |
-
for response in stream:
|
| 27 |
output += response.token.text
|
| 28 |
-
|
| 29 |
return output
|
| 30 |
|
| 31 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|
|
|
|
| 19 |
seed=42,
|
| 20 |
)
|
| 21 |
|
| 22 |
+
formatted_prompt = f" [INST] {system_prompt}, {prompt} [/INST]"
|
|
|
|
| 23 |
output = ""
|
| 24 |
|
| 25 |
+
for response in client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False):
|
| 26 |
output += response.token.text
|
| 27 |
+
|
| 28 |
return output
|
| 29 |
|
| 30 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|