Emmanuel Frimpong Asante
commited on
Commit
·
77812f3
1
Parent(s):
e15e0d8
update space
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ else:
|
|
22 |
print("Setting up MongoDB connection...")
|
23 |
MONGO_URI = os.environ.get("MONGO_URI")
|
24 |
client = MongoClient(MONGO_URI)
|
25 |
-
db = client.
|
26 |
print("MongoDB connection established.")
|
27 |
|
28 |
# Check GPU availability for TensorFlow
|
@@ -171,11 +171,11 @@ def llama2_response(user_input):
|
|
171 |
try:
|
172 |
print("Generating response using Llama 2...")
|
173 |
# Tokenize user input for the Llama 2 model
|
174 |
-
inputs = tokenizer(user_input, return_tensors="pt", truncation=True, max_length=
|
175 |
# Generate a response using the Llama 2 model
|
176 |
outputs = model.generate(
|
177 |
inputs["input_ids"],
|
178 |
-
max_length=
|
179 |
do_sample=True,
|
180 |
temperature=0.7,
|
181 |
pad_token_id=tokenizer.pad_token_id, # Use the newly set padding token
|
|
|
22 |
print("Setting up MongoDB connection...")
|
23 |
MONGO_URI = os.environ.get("MONGO_URI")
|
24 |
client = MongoClient(MONGO_URI)
|
25 |
+
db = client.poultry_management # Database
|
26 |
print("MongoDB connection established.")
|
27 |
|
28 |
# Check GPU availability for TensorFlow
|
|
|
171 |
try:
|
172 |
print("Generating response using Llama 2...")
|
173 |
# Tokenize user input for the Llama 2 model
|
174 |
+
inputs = tokenizer(user_input, return_tensors="pt", truncation=True, max_length=500, padding=True)
|
175 |
# Generate a response using the Llama 2 model
|
176 |
outputs = model.generate(
|
177 |
inputs["input_ids"],
|
178 |
+
max_length=500,
|
179 |
do_sample=True,
|
180 |
temperature=0.7,
|
181 |
pad_token_id=tokenizer.pad_token_id, # Use the newly set padding token
|
training/poultry-disease-classification-model-compared.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|