Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,8 +9,9 @@ from email.mime.text import MIMEText
|
|
| 9 |
from email.mime.multipart import MIMEMultipart
|
| 10 |
import requests
|
| 11 |
import json
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
openai.api_key = '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'
|
| 14 |
|
| 15 |
template = """Shared with you the horoscopes of today, this week, and this month for a couple.
|
| 16 |
Your task is to analyse them provide insights to the couple from all the horoscopes.
|
|
@@ -72,8 +73,10 @@ def get_weekly_pred(url):
|
|
| 72 |
|
| 73 |
def predict_horoscope(m_sign, f_sign,strtime,m_daily_pred,f_daily_pred,m_monthly_pred,f_monthly_pred,m_weekly_pred,f_weekly_pred):
|
| 74 |
# Add your horoscope prediction logic here
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
messages=[
|
| 78 |
{"role": "system", "content": "You are a Horoscope Analyser. Think step by step. Answer in details with professional and dramatic tone"},
|
| 79 |
{"role": "user", "content": template},
|
|
@@ -87,7 +90,11 @@ def predict_horoscope(m_sign, f_sign,strtime,m_daily_pred,f_daily_pred,m_monthly
|
|
| 87 |
{"role": "user", "content": "Wife Weekly Horoscope: " + f_weekly_pred},
|
| 88 |
{"role": "user", "content": "Wife Monthly Horoscope: " + f_monthly_pred}
|
| 89 |
],
|
| 90 |
-
temperature=0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
)
|
| 92 |
time.sleep(1)
|
| 93 |
prediction = chatresponse.choices[0].message.content
|
|
|
|
| 9 |
from email.mime.multipart import MIMEMultipart
|
| 10 |
import requests
|
| 11 |
import json
|
| 12 |
+
from groq import Groq
|
| 13 |
+
|
| 14 |
|
|
|
|
| 15 |
|
| 16 |
template = """Shared with you the horoscopes of today, this week, and this month for a couple.
|
| 17 |
Your task is to analyse them provide insights to the couple from all the horoscopes.
|
|
|
|
| 73 |
|
| 74 |
def predict_horoscope(m_sign, f_sign,strtime,m_daily_pred,f_daily_pred,m_monthly_pred,f_monthly_pred,m_weekly_pred,f_weekly_pred):
|
| 75 |
# Add your horoscope prediction logic here
|
| 76 |
+
client = Groq()
|
| 77 |
+
client = Groq(api_key = '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')
|
| 78 |
+
chatresponse = client.chat.completions.create(
|
| 79 |
+
model="mixtral-8x7b-32768",
|
| 80 |
messages=[
|
| 81 |
{"role": "system", "content": "You are a Horoscope Analyser. Think step by step. Answer in details with professional and dramatic tone"},
|
| 82 |
{"role": "user", "content": template},
|
|
|
|
| 90 |
{"role": "user", "content": "Wife Weekly Horoscope: " + f_weekly_pred},
|
| 91 |
{"role": "user", "content": "Wife Monthly Horoscope: " + f_monthly_pred}
|
| 92 |
],
|
| 93 |
+
temperature=0,
|
| 94 |
+
max_tokens=2048,
|
| 95 |
+
top_p=1,
|
| 96 |
+
stop=None,
|
| 97 |
+
stream=False
|
| 98 |
)
|
| 99 |
time.sleep(1)
|
| 100 |
prediction = chatresponse.choices[0].message.content
|