Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,9 @@ import gradio as gr
|
|
4 |
from huggingface_hub import InferenceClient
|
5 |
|
6 |
model_text = "google/gemma-2-27b-it"
|
7 |
-
client_text = InferenceClient(model_text)
|
8 |
-
|
9 |
model_vision = "google/paligemma2-3b-pt-224"
|
10 |
-
|
|
|
11 |
|
12 |
def fn_text(
|
13 |
prompt,
|
@@ -66,7 +65,7 @@ def fn_vision(
|
|
66 |
if image_url:
|
67 |
messages[0]["content"].append({"type": "image_url", "image_url": {"url": image_url}})
|
68 |
|
69 |
-
stream =
|
70 |
model = model_vision,
|
71 |
messages = messages,
|
72 |
max_tokens = max_tokens,
|
|
|
4 |
from huggingface_hub import InferenceClient
|
5 |
|
6 |
model_text = "google/gemma-2-27b-it"
|
|
|
|
|
7 |
model_vision = "google/paligemma2-3b-pt-224"
|
8 |
+
|
9 |
+
client = InferenceClient()
|
10 |
|
11 |
def fn_text(
|
12 |
prompt,
|
|
|
65 |
if image_url:
|
66 |
messages[0]["content"].append({"type": "image_url", "image_url": {"url": image_url}})
|
67 |
|
68 |
+
stream = client.chat.completions.create(
|
69 |
model = model_vision,
|
70 |
messages = messages,
|
71 |
max_tokens = max_tokens,
|