Spaces:
Paused
Paused
MekkCyber
commited on
Commit
·
89006af
1
Parent(s):
013fddc
update
Browse files
app.py
CHANGED
|
@@ -63,11 +63,13 @@ def run_transformers(model_name, input_text, num_tokens):
|
|
| 63 |
# if oauth_token is None :
|
| 64 |
# return "Error : To Compare please login to your HF account and make sure you have access to the used Llama models"
|
| 65 |
# Load the model and tokenizer dynamically if needed (commented out for performance)
|
| 66 |
-
if model_name=="TinyLlama/TinyLlama-1.1B-Chat-v1.0" :
|
| 67 |
-
|
| 68 |
-
model = AutoModelForCausalLM.from_pretrained('./models/tinyllama')
|
| 69 |
if input_text is None :
|
| 70 |
return "Please provide an input text for the model", None
|
|
|
|
|
|
|
|
|
|
| 71 |
# Encode the input text
|
| 72 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
| 73 |
|
|
|
|
| 63 |
# if oauth_token is None :
|
| 64 |
# return "Error : To Compare please login to your HF account and make sure you have access to the used Llama models"
|
| 65 |
# Load the model and tokenizer dynamically if needed (commented out for performance)
|
| 66 |
+
# if model_name=="TinyLlama/TinyLlama-1.1B-Chat-v1.0" :
|
| 67 |
+
print(input_text)
|
|
|
|
| 68 |
if input_text is None :
|
| 69 |
return "Please provide an input text for the model", None
|
| 70 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 71 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 72 |
+
|
| 73 |
# Encode the input text
|
| 74 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
| 75 |
|