Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 2 |
|
| 3 |
# Load model directly
|
|
@@ -24,11 +27,11 @@ def generate_response(prompt, max_length=150, temperature=1.0):
|
|
| 24 |
return response
|
| 25 |
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
# Importing the required libraries
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
|
| 6 |
# Load model directly
|
|
|
|
| 27 |
return response
|
| 28 |
|
| 29 |
|
| 30 |
+
# Create Gradio interface
|
| 31 |
+
def chat_with_omnicode(prompt):
|
| 32 |
+
response = generate_response(prompt)
|
| 33 |
+
return response
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
iface = gr.Interface(fn=chat_with_omnicode, inputs="text", outputs="text", title="OmniCode")
|
| 37 |
+
iface.launch()
|