Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import numpy as np
|
|
8 |
from pypdf import PdfReader
|
9 |
from gradio_pdf import PDF
|
10 |
from transformers import pipeline
|
11 |
-
|
12 |
|
13 |
|
14 |
title = "Mistral-7B-Instruct-GGUF Run On CPU-Basic Free Hardware"
|
@@ -30,15 +30,15 @@ model_name = "SmolLM-1.7B-Instruct.Q2_K.gguf"
|
|
30 |
hf_hub_download(repo_id="mradermacher/SmolLM-1.7B-Instruct-GGUF", filename=model_name, local_dir=model_path, local_dir_use_symlinks=False)
|
31 |
"""
|
32 |
|
33 |
-
|
34 |
import torch
|
35 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
|
37 |
|
38 |
-
model_name = "
|
39 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
40 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.
|
41 |
-
|
42 |
print("Start the model init process")
|
43 |
"""model = model = GPT4All(model_name, model_path, allow_download = False, device="cpu")
|
44 |
|
@@ -49,10 +49,7 @@ model._is_chat_session_activated = False
|
|
49 |
|
50 |
max_new_tokens = 2048"""
|
51 |
|
52 |
-
transformers = import_transformers_js()
|
53 |
-
pipeline = transformers.pipeline
|
54 |
|
55 |
-
pipe = pipeline('text-generation', 'Xenova/distilgpt2')
|
56 |
|
57 |
model_kwargs = {'device': 'cpu'}
|
58 |
encode_kwargs = {'normalize_embeddings': False}
|
|
|
8 |
from pypdf import PdfReader
|
9 |
from gradio_pdf import PDF
|
10 |
from transformers import pipeline
|
11 |
+
|
12 |
|
13 |
|
14 |
title = "Mistral-7B-Instruct-GGUF Run On CPU-Basic Free Hardware"
|
|
|
30 |
hf_hub_download(repo_id="mradermacher/SmolLM-1.7B-Instruct-GGUF", filename=model_name, local_dir=model_path, local_dir_use_symlinks=False)
|
31 |
"""
|
32 |
|
33 |
+
|
34 |
import torch
|
35 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
|
37 |
|
38 |
+
model_name = "microsoft/Phi-3.5-mini-instructe"
|
39 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
40 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.int8, device_map="auto")
|
41 |
+
|
42 |
print("Start the model init process")
|
43 |
"""model = model = GPT4All(model_name, model_path, allow_download = False, device="cpu")
|
44 |
|
|
|
49 |
|
50 |
max_new_tokens = 2048"""
|
51 |
|
|
|
|
|
52 |
|
|
|
53 |
|
54 |
model_kwargs = {'device': 'cpu'}
|
55 |
encode_kwargs = {'normalize_embeddings': False}
|