|
|
|
""" |
|
Created on Sat Oct 5 16:41:22 2024 |
|
|
|
@author: Admin |
|
""" |
|
|
|
import gradio as gr |
|
from transformers import pipeline |
|
import os |
|
|
|
|
|
|
|
token = os.getenv("HF_TOKEN") |
|
chatbot = pipeline(model="meta-llama/Llama-3.2-1B", use_auth_token=token) |
|
|
|
|
|
message_list = [] |
|
response_list = [] |
|
|
|
|
|
def vanilla_chatbot(message, history): |
|
conversation = chatbot(message) |
|
|
|
return conversation[0]['generated_text'] |
|
|
|
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Vanilla Chatbot", description="Enter text to start chatting.") |
|
|
|
demo_chatbot.launch() |