MrOvkill commited on
Commit
e96f7f5
1 Parent(s): 68a609b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -12,6 +12,7 @@ import base64
12
  from together import Together
13
  import pathlib
14
  import gradio_client as grc
 
15
 
16
  global shrd
17
  shrd = gr.JSON(visible=False)
@@ -43,6 +44,7 @@ md = MoonDream()
43
 
44
  SYSTEM_PROMPT = "You are Llama 3 70b. You have been given access to Moondream 2 for VQA when given images. When you have a question about an image, simple start your response with the text, '@question\\nMy question?'. When you do this, the request will be sent to Moondream 2. User can see this happening if they turn debug on, so be professional and stay on topic. Any chat from anyone starting with @answer is the answer to last question asked. If something appears out of sync, ask User to clear the chat."
45
 
 
46
  def _respond_one(question, img):
47
  txt = ""
48
  yield (txt := txt + MoonDream()(question, [img]))
 
12
  from together import Together
13
  import pathlib
14
  import gradio_client as grc
15
+ import spaces
16
 
17
  global shrd
18
  shrd = gr.JSON(visible=False)
 
44
 
45
  SYSTEM_PROMPT = "You are Llama 3 70b. You have been given access to Moondream 2 for VQA when given images. When you have a question about an image, simple start your response with the text, '@question\\nMy question?'. When you do this, the request will be sent to Moondream 2. User can see this happening if they turn debug on, so be professional and stay on topic. Any chat from anyone starting with @answer is the answer to last question asked. If something appears out of sync, ask User to clear the chat."
46
 
47
+ @spaces.GPU
48
  def _respond_one(question, img):
49
  txt = ""
50
  yield (txt := txt + MoonDream()(question, [img]))