Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,7 @@ Join us : πTeamTonicπ is always making cool demos! Join our active builder
|
|
11 |
|
12 |
model_name = "allenai/OLMo-7B"
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
14 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16)
|
15 |
-
# model = AutoModelForCausalLM.from_pretrained(model_name)
|
16 |
|
17 |
def generate_text(prompt, max_new_tokens, top_k, top_p, do_sample):
|
18 |
inputs = tokenizer(prompt, return_tensors='pt', return_token_type_ids=False)
|
|
|
11 |
|
12 |
model_name = "allenai/OLMo-7B"
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, load_in_8bit=True)
|
|
|
15 |
|
16 |
def generate_text(prompt, max_new_tokens, top_k, top_p, do_sample):
|
17 |
inputs = tokenizer(prompt, return_tensors='pt', return_token_type_ids=False)
|