File size: 509 Bytes
70d60d7
 
 
56fb41f
 
 
 
 
 
 
 
 
 
 
 
 
70d60d7
 
56fb41f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from huggingface_hub import InferenceClient

client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")

def ai_tutor(message, history):
    response = client.chat_completion(
        messages=[{"role": "user", "content": message}],
        max_tokens=200
    )
    return response.choices[0].message.content

demo = gr.ChatInterface(
    fn=ai_tutor,
    title="SIUT AITutor",
    description="An AI-powered tutor helping students learn AI, cybersecurity, and programming."
)

demo.launch()