Spaces:
Runtime error
Runtime error
File size: 614 Bytes
8a6183c 73f7377 406399b 8a6183c 406399b 8a6183c 406399b 8a6183c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from transformers import pipeline
chat_pipe = pipeline("conversational", model="alpindale/goliath-120b")
# Define a function to generate responses
def generate_response(user_input):
# Generate response from the chat pipeline
response = chat_pipe(user_input)[0]['generated_responses'][0]
return response
# Create Gradio Interface
iface = gr.Interface(
fn=generate_response,
inputs=gr.Textbox(),
outputs=gr.Textbox(),
live=True,
title="Conversational Chat",
description="Chat with the AI model using Gradio!"
)
# Launch the Gradio interface
iface.launch()
|