Lynexn commited on
Commit
2d1251a
·
verified ·
1 Parent(s): 69a3aca

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load the model
5
+ chatbot = pipeline("text-generation", model="aisak-ai/aisak-assistant")
6
+
7
+ # Define the chat function
8
+ def chat_with_ai(prompt):
9
+ response = chatbot(prompt, max_length=50, num_return_sequences=1)
10
+ return response[0]['generated_text']
11
+
12
+ # Create the Gradio interface
13
+ interface = gr.Interface(fn=chat_with_ai, inputs="text", outputs="text")
14
+
15
+ # Launch the interface
16
+ interface.launch()