Spaces:
Runtime error
Runtime error
File size: 1,267 Bytes
d812224 391eed3 d812224 391eed3 fda7a07 d812224 680dca7 d812224 680dca7 d812224 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
from gradio_client import Client
import os
HUGGINGFACEHUB_API_TOKEN=os.getenv("HUGGINGFACEHUB_API_TOKEN")
#client = Client("https://binqiangliu-llama2-with-gradio-chat.hf.space/", hf_token=HUGGINGFACEHUB_API_TOKEN, serialize=False)
client = Client("https://binqiangliu-llama2-with-gradio-chat.hf.space/")
result = client.predict(
"", # str (filepath to JSON file) in 'parameter_4' Json component
"Howdy!", # str in '' Textbox component
"Howdy!", # str in 'parameter_84' Textbox component
0, # int | float (numeric value between 0.0 and 2.0) in 'temp' Slider component
20, # int | float (numeric value between 20 and 1000) in 'top_k' Slider component
0, # int | float (numeric value between 0.0 and 2.0) in 'rep_penalty' Slider component
64, # int | float (numeric value between 64 and 8192) in 'new_tokens' Slider component
"true", # str in 'sample' Radio component
2, # int | float (numeric value between 2 and 10) in 'number of recent talks to keep' Slider component
"on", # str in 'internet mode' Radio component
"05e6a9eace677f93c0e4a93f750c12d03c1f81e043630cb93378da46ce616567", # str in 'Serper api key' Textbox component
fn_index=21
)
print(result) |