Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -2,6 +2,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
2 |
from flask import Flask, request, jsonify
|
3 |
|
4 |
device = "cuda" # the device to load the model onto
|
|
|
|
|
5 |
|
6 |
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
7 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
|
|
2 |
from flask import Flask, request, jsonify
|
3 |
|
4 |
device = "cuda" # the device to load the model onto
|
5 |
+
from transformers import set_cache_dir
|
6 |
+
set_cache_dir("/code/.cache/huggingface")
|
7 |
|
8 |
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
9 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|