File size: 557 Bytes
e765751
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from gradio_client import Client

# Initialize the client and set the API endpoint URL
client = Client("https://stabilityai-stablelm-tuned-alpha-chat.hf.space/")
client.predict(
				fn_index=5
)
file1 = client.predict(fn_index=6)
# Send a "start" message to begin the conversation
result = client.predict("start", file1, fn_index=0)
conversation_id = result[1]

# Send a chat message and get the response
while True:
    message = input("You: ")
    result = client.predict(message, conversation_id, fn_index=2)
    print("Bot:", open(result[1],'r').read())