Spaces:
Paused
Paused
Update llm.py
Browse files
llm.py
CHANGED
|
@@ -20,18 +20,12 @@ text = """
|
|
| 20 |
"""
|
| 21 |
|
| 22 |
print("loading model")
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
model = pipeline("text-generation",
|
| 31 |
-
model="mistralai/Mistral-7B-v0.1",
|
| 32 |
-
tokenizer="mistralai/Mistral-7B-v0.1",
|
| 33 |
-
device_map="auto", # Adjust if GPU is available
|
| 34 |
-
torch_dtype="auto")
|
| 35 |
|
| 36 |
print("loading model done!")
|
| 37 |
|
|
|
|
| 20 |
"""
|
| 21 |
|
| 22 |
print("loading model")
|
| 23 |
+
model = HuggingFacePipeline.from_model_id(
|
| 24 |
+
model_id="bartowski/Meta-Llama-3.1-8B-Instruct-GGUF",
|
| 25 |
+
task="text-generation",
|
| 26 |
+
pipeline_kwargs={"temperature":1, "max_length":1000,
|
| 27 |
+
"repetition_penalty":1.25, "max_new_tokens": 2000}
|
| 28 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
print("loading model done!")
|
| 31 |
|