Downloads · 30 days
0
Vijay13122007/Captain-chatbot
Captain-chatbot is a machine learning model from Vijay13122007. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Feb 26, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 73%
From the Hugging Face model README
import openai import gradio as gr
openai.api_key = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key
def chat_with_gpt(message): response = openai.ChatCompletion.create( model="gpt-3.5-turbo", # Use "gpt-4" if you have access messages=[{"role": "user", "content": message}] ) return response["choices"][0]["message"]["content"]
iface = gr.Interface( fn=chat_with_gpt, inputs="text", outputs="text", title="My Personal Chatbot", description="Talk to your personal AI assistant!" )
iface.launch()