Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import random
|
| 2 |
import torch
|
| 3 |
import gradio as gr
|
|
@@ -16,6 +17,7 @@ def get_text_from_content(content):
|
|
| 16 |
texts.append("[Image]")
|
| 17 |
return " ".join(texts)
|
| 18 |
|
|
|
|
| 19 |
def chat_inference(image, text, temperature, top_p, top_k, max_tokens, conversation):
|
| 20 |
if conversation is None:
|
| 21 |
conversation = []
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import random
|
| 3 |
import torch
|
| 4 |
import gradio as gr
|
|
|
|
| 17 |
texts.append("[Image]")
|
| 18 |
return " ".join(texts)
|
| 19 |
|
| 20 |
+
@spaces.GPU
|
| 21 |
def chat_inference(image, text, temperature, top_p, top_k, max_tokens, conversation):
|
| 22 |
if conversation is None:
|
| 23 |
conversation = []
|