Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ description = "You can use [🐋🐳microsoft/Orca-2-13b](https://huggingface.co
|
|
12 |
# os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
|
13 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
14 |
model_name = "microsoft/Orca-2-13b"
|
15 |
-
offload_folder = './model_weights'
|
16 |
|
17 |
if not os.path.exists(offload_folder):
|
18 |
os.makedirs(offload_folder)
|
@@ -20,7 +20,7 @@ if not os.path.exists(offload_folder):
|
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
21 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
22 |
model = model.to(torch.bfloat16)
|
23 |
-
model = model.to(device_map='auto'
|
24 |
|
25 |
class OrcaChatBot:
|
26 |
def __init__(self, model, tokenizer, system_message="You are Orca, an AI language model created by Microsoft. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
|
|
|
12 |
# os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
|
13 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
14 |
model_name = "microsoft/Orca-2-13b"
|
15 |
+
# offload_folder = './model_weights'
|
16 |
|
17 |
if not os.path.exists(offload_folder):
|
18 |
os.makedirs(offload_folder)
|
|
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
21 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
22 |
model = model.to(torch.bfloat16)
|
23 |
+
model = model.to(device_map='auto')
|
24 |
|
25 |
class OrcaChatBot:
|
26 |
def __init__(self, model, tokenizer, system_message="You are Orca, an AI language model created by Microsoft. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
|