lewtun HF staff commited on
Commit
0fab3cb
1 Parent(s): e9f7265

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -32,7 +32,7 @@ def bot_streaming(message, history):
32
 
33
  if image is None:
34
  gr.Error("You need to upload an image for LLaVA to work.")
35
- prompt=f"[INST] <image>\n{message['text']} [/INST]"
36
  image = Image.open(image).convert("RGB")
37
  inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
38
 
@@ -43,7 +43,7 @@ def bot_streaming(message, history):
43
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
44
  thread.start()
45
 
46
- text_prompt =f"[INST] \n{message['text']} [/INST]"
47
 
48
 
49
  buffer = ""
 
32
 
33
  if image is None:
34
  gr.Error("You need to upload an image for LLaVA to work.")
35
+ prompt=f"USER: <image>\n{message['text']}\nASSISTANT:" #f"[INST] <image>\n{message['text']} [/INST]"
36
  image = Image.open(image).convert("RGB")
37
  inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
38
 
 
43
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
44
  thread.start()
45
 
46
+ text_prompt =f"USER: \n{message['text']}\nASSISTANT:" #f"[INST] \n{message['text']} [/INST]"
47
 
48
 
49
  buffer = ""