Spaces:
Paused
Paused
Update endpoints.py
Browse files- endpoints.py +5 -3
endpoints.py
CHANGED
@@ -16,7 +16,10 @@ import requests
|
|
16 |
def LLM(llm_name, length):
|
17 |
print(llm_name)
|
18 |
tokenizer = AutoTokenizer.from_pretrained(llm_name)
|
19 |
-
model = AutoModelForCausalLM.from_pretrained(llm_name
|
|
|
|
|
|
|
20 |
pipe = pipeline("text-generation",
|
21 |
model=model,
|
22 |
tokenizer=tokenizer,
|
@@ -28,8 +31,7 @@ def LLM(llm_name, length):
|
|
28 |
return pipe
|
29 |
|
30 |
|
31 |
-
pipe = LLM("
|
32 |
-
|
33 |
# tokenizer = AutoTokenizer.from_pretrained("WizardLM/WizardCoder-1B-V1.0")
|
34 |
# base_model = AutoModelForCausalLM.from_pretrained("WizardLM/WizardCoder-1B-V1.0")
|
35 |
# Mistral 7B
|
|
|
16 |
def LLM(llm_name, length):
|
17 |
print(llm_name)
|
18 |
tokenizer = AutoTokenizer.from_pretrained(llm_name)
|
19 |
+
model = AutoModelForCausalLM.from_pretrained(llm_name,
|
20 |
+
trust_remote_code=True,
|
21 |
+
device_map="auto",
|
22 |
+
load_in_8bit=True)
|
23 |
pipe = pipeline("text-generation",
|
24 |
model=model,
|
25 |
tokenizer=tokenizer,
|
|
|
31 |
return pipe
|
32 |
|
33 |
|
34 |
+
pipe = LLM("replit/replit-code-v1-3b",4000)
|
|
|
35 |
# tokenizer = AutoTokenizer.from_pretrained("WizardLM/WizardCoder-1B-V1.0")
|
36 |
# base_model = AutoModelForCausalLM.from_pretrained("WizardLM/WizardCoder-1B-V1.0")
|
37 |
# Mistral 7B
|