Spaces:
Runtime error
Runtime error
import gradio as gr | |
from gradio_client import Client | |
import os | |
#client = Client("https://binqiangliu-llama2-with-gradio-chat.hf.space/") | |
HUGGINGFACEHUB_API_TOKEN=os.getenv("HUGGINGFACEHUB_API_TOKEN") | |
#client = Client("https://huggingface.co/spaces/binqiangliu/aichat", hf_token=HUGGINGFACEHUB_API_TOKEN, serialize=False) | |
#this not working: in _get_config raise ValueError(ValueError: Could not get Gradio config from: https://huggingface.co/spaces/binqiangliu/aichat/ | |
#client = Client("https://binqiangliu-aichat.hf.space/", hf_token=HUGGINGFACEHUB_API_TOKEN, serialize=False) | |
#this works with private Gradio HF Space, hf_token from the Gradio App creator HF account. | |
#client = Client("https://huggingface.co/spaces/AIShare/aichatbot", hf_token=HUGGINGFACEHUB_API_TOKEN, serialize=False) | |
#this not working: in _get_config raise ValueError(ValueError: Could not get Gradio config from: https://huggingface.co/spaces/AIShare/aichatbot/ | |
#client = Client("https://AIShare-aichatbot.hf.space/", hf_token=HUGGINGFACEHUB_API_TOKEN, serialize=False) | |
#this works with private Gradio HF Space, hf_token from the Gradio App creator HF account. | |
client = Client("https://AIShare-aichatbot.hf.space/", hf_token=HUGGINGFACEHUB_API_TOKEN) | |
#this works with private Gradio HF Space as well! hf_token from the Gradio App creator HF account. | |
result = client.predict( | |
"Private Gradio HF Space api-ed with hf_token from the Creator! Great Job!", # str in 'parameter_50' Textbox component | |
fn_index=1 | |
) | |
print(result) |