GPT-2-test / app.py
lachine's picture
Create app.py
e765751
raw
history blame
557 Bytes
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())