Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Initialize your chatbot model here with LLaMA-2 | |
| model_name = "Llama-2-7b" # Adjust this to the specific variant of LLaMA-2 you wish to use | |
| chatbot = pipeline("text-generation", model=model_name, use_auth_token="ZEN") | |
| def chat_with_bot(user_input): | |
| # Generating a response from the chatbot model | |
| responses = chatbot(user_input, max_length=800, num_return_sequences=1) | |
| return responses[0]["generated_text"] | |
| # Setting up the Gradio interface | |
| iface = gr.Interface(fn=chat_with_bot, | |
| inputs=gr.inputs.Textbox(lines=2, placeholder="Type your question here..."), | |
| outputs="text", | |
| title="Advanced Chatbot", | |
| description="This is an advanced chatbot powered by LLaMA-2. Type your question and get an answer.") | |
| if __name__ == "__main__": | |
| iface.launch() | |