Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,10 @@ import os
|
|
3 |
os.system("pip install transformers sentencepiece torch")
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained("yniw/open-calm-7b-4gib")
|
7 |
-
model = AutoModelForCausalLM.from_pretrained("yniw/open-calm-7b-4gib")
|
8 |
|
|
|
|
|
|
|
9 |
def generate_text(input_text, temperature=0.8, max_length=20):
|
10 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
11 |
output = model.generate(input_ids, max_length=max_length, temperature=temperature)
|
|
|
3 |
os.system("pip install transformers sentencepiece torch")
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
|
|
|
|
|
6 |
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained("kyo-takano/open-calm-7b-8bit")
|
8 |
+
|
9 |
+
model = AutoModelForCausalLM.from_pretrained("kyo-takano/open-calm-7b-8bit")
|
10 |
def generate_text(input_text, temperature=0.8, max_length=20):
|
11 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
12 |
output = model.generate(input_ids, max_length=max_length, temperature=temperature)
|