Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
gr.load("models/codellama/CodeLlama-7b-hf").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
gr.load("models/codellama/CodeLlama-7b-hf").launch()
|
| 5 |
+
|
| 6 |
+
# Prompt the user for input
|
| 7 |
+
user_input = input("AI: Ask me anything\nMe: ")
|
| 8 |
+
|
| 9 |
+
# Generate a response using the pipeline
|
| 10 |
+
generated_response = text_generation_pipeline(user_input, max_length=200)[0]['generated_text']
|
| 11 |
+
|
| 12 |
+
print("AI:", generated_response)
|