Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,8 +19,7 @@ def process_input(image, image_url, prompt, model, hf_token):
|
|
| 19 |
raise gr.Error("Invalid Hugging Face token. It should start with 'hf_'")
|
| 20 |
|
| 21 |
client = InferenceClient(
|
| 22 |
-
|
| 23 |
-
token=hf_token,
|
| 24 |
provider="cohere"
|
| 25 |
)
|
| 26 |
|
|
@@ -43,8 +42,9 @@ def process_input(image, image_url, prompt, model, hf_token):
|
|
| 43 |
|
| 44 |
try:
|
| 45 |
stream = client.chat.completions.create(
|
|
|
|
| 46 |
messages=messages,
|
| 47 |
-
max_tokens=
|
| 48 |
stream=True,
|
| 49 |
)
|
| 50 |
|
|
|
|
| 19 |
raise gr.Error("Invalid Hugging Face token. It should start with 'hf_'")
|
| 20 |
|
| 21 |
client = InferenceClient(
|
| 22 |
+
api_key=hf_token,
|
|
|
|
| 23 |
provider="cohere"
|
| 24 |
)
|
| 25 |
|
|
|
|
| 42 |
|
| 43 |
try:
|
| 44 |
stream = client.chat.completions.create(
|
| 45 |
+
model=model,
|
| 46 |
messages=messages,
|
| 47 |
+
max_tokens=8000,
|
| 48 |
stream=True,
|
| 49 |
)
|
| 50 |
|