Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -81,11 +81,21 @@ def get_chain(temperature):
|
|
81 |
|
82 |
# Replace the local OLMOLLM with the Hugging Face model
|
83 |
|
84 |
-
model_name = "
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
|
91 |
# Initialize the LangChain HuggingFacePipeline
|
|
|
81 |
|
82 |
# Replace the local OLMOLLM with the Hugging Face model
|
83 |
|
84 |
+
model_name = "OLMo-7B-Instruct-Q4_K_M"
|
85 |
+
|
86 |
+
# Load the tokenizer and model
|
87 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
88 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
89 |
+
|
90 |
+
# Create a text generation pipeline with the model
|
91 |
+
pipe = pipeline(
|
92 |
+
"text-generation",
|
93 |
+
model=model,
|
94 |
+
tokenizer=tokenizer,
|
95 |
+
max_length=2200, # Adjust based on your input length
|
96 |
+
max_new_tokens=100, # Number of tokens to generate
|
97 |
+
temperature=temperature # Adjust the creativity of the output
|
98 |
+
)
|
99 |
|
100 |
|
101 |
# Initialize the LangChain HuggingFacePipeline
|