Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline, Conversation
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
chatbot = pipeline(model="bigcode/starcoder2-15b")
|
| 5 |
+
|
| 6 |
+
message_list = []
|
| 7 |
+
response_list = []
|
| 8 |
+
|
| 9 |
+
def vanilla_chatbot(message, history):
|
| 10 |
+
conversation = chatbot(message)
|
| 11 |
+
|
| 12 |
+
return conversation[0]['generated_text']
|
| 13 |
+
|
| 14 |
+
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="YourCoder Chatbot", description="Enter piece of code to generate a code review!")
|
| 15 |
+
|
| 16 |
+
demo_chatbot.launch()
|