Araeynn commited on
Commit
b655331
1 Parent(s): 49b8f9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -29,6 +29,7 @@ hermes = "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO"
29
  codellama = "codellama/CodeLlama-70b-Instruct-hf"
30
 
31
  async def chat(conversationId, ip, cookie):
 
32
  url = f"https://huggingface.co/chat/conversation/{conversationId}"
33
 
34
  payload = {
@@ -47,8 +48,9 @@ async def chat(conversationId, ip, cookie):
47
  "content-type": "application/json",
48
  }
49
 
50
- response = session.post(url, json=payload, headers=headers)
51
- return response
 
52
 
53
  @client.tree.command(
54
  description="Starts the conversation with Lyre.",
 
29
  codellama = "codellama/CodeLlama-70b-Instruct-hf"
30
 
31
  async def chat(conversationId, ip, cookie):
32
+ s = requests.Session()
33
  url = f"https://huggingface.co/chat/conversation/{conversationId}"
34
 
35
  payload = {
 
48
  "content-type": "application/json",
49
  }
50
 
51
+ response = s.post(url, json=payload, headers=headers)
52
+ return response
53
+ s.close()
54
 
55
  @client.tree.command(
56
  description="Starts the conversation with Lyre.",