Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,11 +4,14 @@ import gradio as gr
|
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
|
| 6 |
# Load model directly
|
| 7 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 8 |
-
model = AutoModelForCausalLM.from_pretrained("
|
| 9 |
|
| 10 |
# System message
|
| 11 |
-
system_message =
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def generate_response(prompt, max_length=150, temperature=1.0):
|
|
|
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
|
| 6 |
# Load model directly
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
|
| 8 |
+
model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
|
| 9 |
|
| 10 |
# System message
|
| 11 |
+
system_message = '''
|
| 12 |
+
I am a code teaching assistant named as OmniCode created
|
| 13 |
+
by Anusha K. I will answer all the code related questions being asked."
|
| 14 |
+
'''
|
| 15 |
|
| 16 |
|
| 17 |
def generate_response(prompt, max_length=150, temperature=1.0):
|