Sam-Orion
commited on
Commit
·
1f8e7d8
1
Parent(s):
3abf791
Indus 3.0 Demo
Browse files
app.py
CHANGED
|
@@ -46,8 +46,13 @@ if model_path is None:
|
|
| 46 |
raise FileNotFoundError("config.json not found after extraction")
|
| 47 |
|
| 48 |
# Load from the extracted folder
|
| 49 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 50 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
def chat_fn(prompt, history):
|
| 53 |
history = history or []
|
|
|
|
| 46 |
raise FileNotFoundError("config.json not found after extraction")
|
| 47 |
|
| 48 |
# Load from the extracted folder
|
| 49 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 50 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 51 |
+
model_path,
|
| 52 |
+
torch_dtype="auto",
|
| 53 |
+
device_map="auto",
|
| 54 |
+
low_cpu_mem_usage=True
|
| 55 |
+
)
|
| 56 |
|
| 57 |
def chat_fn(prompt, history):
|
| 58 |
history = history or []
|