Spaces:
Sleeping
Sleeping
Delete model.py
Browse files
model.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
from transformers import pipeline
|
2 |
-
|
3 |
-
def load_llm():
|
4 |
-
return pipeline(
|
5 |
-
"text-generation",
|
6 |
-
model="mistralai/Mistral-7B-Instruct-v0.1",
|
7 |
-
device_map="auto",
|
8 |
-
trust_remote_code=True
|
9 |
-
)
|
10 |
-
|
11 |
-
def get_response(pipe, prompt, max_new_tokens=256):
|
12 |
-
out = pipe(prompt, max_new_tokens=max_new_tokens, do_sample=True)
|
13 |
-
return out[0]["generated_text"].split("User:")[-1].strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|