Spaces:
Runtime error
Runtime error
Update app_dialogue.py
Browse files- app_dialogue.py +6 -2
app_dialogue.py
CHANGED
|
@@ -12,7 +12,9 @@ import gradio as gr
|
|
| 12 |
import PIL
|
| 13 |
from gradio import processing_utils
|
| 14 |
from gradio_client.client import DEFAULT_TEMP_DIR
|
| 15 |
-
from
|
|
|
|
|
|
|
| 16 |
from transformers import AutoProcessor
|
| 17 |
|
| 18 |
|
|
@@ -505,12 +507,14 @@ with gr.Blocks(title="IDEFICS Playground", theme=gr.themes.Base()) as demo:
|
|
| 505 |
current_image=image,
|
| 506 |
history=chat_history,
|
| 507 |
)
|
|
|
|
| 508 |
|
|
|
|
| 509 |
client_endpoint = API_PATHS[model_selector]
|
| 510 |
client = Client(
|
| 511 |
base_url=client_endpoint,
|
| 512 |
headers={"x-use-cache": "0", "Authorization": f"Bearer {API_TOKEN}"},
|
| 513 |
-
)
|
| 514 |
|
| 515 |
# Common parameters to all decoding strategies
|
| 516 |
# This documentation is useful to read: https://huggingface.co/docs/transformers/main/en/generation_strategies
|
|
|
|
| 12 |
import PIL
|
| 13 |
from gradio import processing_utils
|
| 14 |
from gradio_client.client import DEFAULT_TEMP_DIR
|
| 15 |
+
from huggingface_hub import InferenceClient
|
| 16 |
+
|
| 17 |
+
#from text_generation import Client
|
| 18 |
from transformers import AutoProcessor
|
| 19 |
|
| 20 |
|
|
|
|
| 507 |
current_image=image,
|
| 508 |
history=chat_history,
|
| 509 |
)
|
| 510 |
+
client = InferenceClient("HuggingFaceM4/idefics-80b-instruct")
|
| 511 |
|
| 512 |
+
'''
|
| 513 |
client_endpoint = API_PATHS[model_selector]
|
| 514 |
client = Client(
|
| 515 |
base_url=client_endpoint,
|
| 516 |
headers={"x-use-cache": "0", "Authorization": f"Bearer {API_TOKEN}"},
|
| 517 |
+
)'''
|
| 518 |
|
| 519 |
# Common parameters to all decoding strategies
|
| 520 |
# This documentation is useful to read: https://huggingface.co/docs/transformers/main/en/generation_strategies
|