API not working. Priority: High

#19
by Rupnil - opened

I tried the following code:

from gradio_client import Client

client = Client("https://tiiuae-falcon-chat.hf.space/", serialize=False)
result = client.predict("Howdy!",fn_index=0)
print(result)

But, its giving an error:
image.png

Please look into this matter and solve it as soon as possible.

This code should fix your problems:

from gradio_client import Client

client = Client("tiiuae/falcon-180b-demo")
result = client.predict("Howdy!", "You are a helpful assistant", 0.9, 256, 0.9, 1.2)
print(result)

Here are the parameters for the predict function:

predict(message, optional_system_prompt, temperature, max_new_tokens, topp_nucleus_sampling, repetition_penalty)

@Techpro864 VER VERY THANKS!! IT WORKED

Rupnil changed discussion status to closed
Rupnil changed discussion status to open

But how do I add the history thing, or do we have to do it ourselves using another script that does that?

You have to add that yourself because the only function is predict and there is no way to pass in message history.

Oh alright, i already did it lmao ๐Ÿคฃ

Rupnil changed discussion status to closed

Sign up or log in to comment