Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,21 +17,15 @@ client = Groq(api_key=groq_api_key)
|
|
| 17 |
|
| 18 |
System_msg = "act as an experienced blockchain developer,you have been working in this field from the past 15 years.help me understand some concepts, assume i am a complete begineer"
|
| 19 |
|
| 20 |
-
ipAddress = None
|
| 21 |
|
| 22 |
def nowInISt():
|
| 23 |
return dt.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 24 |
|
| 25 |
-
def attachIp(request = gr.Request):
|
| 26 |
-
global ipAddress
|
| 27 |
-
x_forwarded_for = request.headers.get("x-forwarded-for")
|
| 28 |
-
if x_forwarded_for:
|
| 29 |
-
ipAddress = x_forwarded_for
|
| 30 |
|
| 31 |
def pprint(log: str):
|
| 32 |
now = nowInISt()
|
| 33 |
now = now.strftime("%Y-%m-%d %H:%M:%S")
|
| 34 |
-
print(f"[{now}]
|
| 35 |
|
| 36 |
def predict(message,history):
|
| 37 |
history_list = [{"role": "system", "content": System_msg}]
|
|
@@ -69,7 +63,6 @@ with gr.ChatInterface(
|
|
| 69 |
scale = 7,
|
| 70 |
max_lines = 2,
|
| 71 |
),
|
| 72 |
-
) as demo
|
| 73 |
-
demo.load(attachIp,None,None)
|
| 74 |
|
| 75 |
demo.launch()
|
|
|
|
| 17 |
|
| 18 |
System_msg = "act as an experienced blockchain developer,you have been working in this field from the past 15 years.help me understand some concepts, assume i am a complete begineer"
|
| 19 |
|
|
|
|
| 20 |
|
| 21 |
def nowInISt():
|
| 22 |
return dt.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
def pprint(log: str):
|
| 26 |
now = nowInISt()
|
| 27 |
now = now.strftime("%Y-%m-%d %H:%M:%S")
|
| 28 |
+
print(f"[{now}] {log}")
|
| 29 |
|
| 30 |
def predict(message,history):
|
| 31 |
history_list = [{"role": "system", "content": System_msg}]
|
|
|
|
| 63 |
scale = 7,
|
| 64 |
max_lines = 2,
|
| 65 |
),
|
| 66 |
+
) as demo
|
|
|
|
| 67 |
|
| 68 |
demo.launch()
|