Spaces:
Sleeping
Sleeping
Commit
·
da0e064
1
Parent(s):
cb4656b
final touch by me
Browse files- .gitignore +3 -1
- app.py +19 -3
.gitignore
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
plant_disease_model.tflite
|
| 2 |
.env
|
| 3 |
-
app2.py
|
|
|
|
|
|
|
|
|
| 1 |
plant_disease_model.tflite
|
| 2 |
.env
|
| 3 |
+
app2.py
|
| 4 |
+
themeCheck.py
|
| 5 |
+
.gradio
|
app.py
CHANGED
|
@@ -58,10 +58,26 @@ def predict_image_class(image):
|
|
| 58 |
# -----------------------------
|
| 59 |
def grok_chatbot(user_message):
|
| 60 |
payload = {
|
| 61 |
-
"model": "openai/gpt-oss-20b",
|
| 62 |
-
"messages": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
"temperature": 0.7,
|
| 64 |
-
"max_tokens":
|
| 65 |
}
|
| 66 |
|
| 67 |
headers = {
|
|
|
|
| 58 |
# -----------------------------
|
| 59 |
def grok_chatbot(user_message):
|
| 60 |
payload = {
|
| 61 |
+
"model": "openai/gpt-oss-20b",
|
| 62 |
+
"messages": [
|
| 63 |
+
{
|
| 64 |
+
"role": "system",
|
| 65 |
+
"content": (
|
| 66 |
+
"if answer can be given in short then give short answer. otherwise format it on the basis of below prompts and give answer. "
|
| 67 |
+
"Format your response in a clean, professional style. "
|
| 68 |
+
"Use short headings with clear spacing. "
|
| 69 |
+
"Use numbered or bulleted lists instead of large tables. "
|
| 70 |
+
"Highlight important points with emojis or concise labels, not asterisks. "
|
| 71 |
+
"Keep the layout visually easy to scan, like a guide or checklist."
|
| 72 |
+
)
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"role": "user",
|
| 76 |
+
"content": f"{user_message}\n\n(Please answer in under 400 words.)"
|
| 77 |
+
}
|
| 78 |
+
],
|
| 79 |
"temperature": 0.7,
|
| 80 |
+
"max_tokens": 1000
|
| 81 |
}
|
| 82 |
|
| 83 |
headers = {
|