SpyC0der77 commited on
Commit
02458f6
·
verified ·
1 Parent(s): 071c36e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -3,7 +3,7 @@ from huggingface_hub import InferenceClient
3
  import os
4
 
5
  client = InferenceClient("EvanZhouDev/open-genmoji", token=os.getenv("HUGGINGFACE_API_TOKEN"))
6
- llm = InferenceClient(api_key=os.getenv("HUGGINGFACE_API_TOKEN"))
7
 
8
  # Define the process function that takes a text prompt and returns an image
9
  def process(prompt):
@@ -13,13 +13,7 @@ def process(prompt):
13
  { "role": "user", "content": prompt }
14
  ]
15
 
16
- completion = llm.chat.completions.create(
17
- model="Qwen/Qwen2.5-72B-Instruct",
18
- messages=messages,
19
- temperature=0.5,
20
- max_tokens=2048,
21
- top_p=0.7
22
- )
23
  response = completion.get("choices")[0].get("message").get("content").replace("```", "").replace("\n", "")
24
 
25
  print(response)
 
3
  import os
4
 
5
  client = InferenceClient("EvanZhouDev/open-genmoji", token=os.getenv("HUGGINGFACE_API_TOKEN"))
6
+ llm = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
7
 
8
  # Define the process function that takes a text prompt and returns an image
9
  def process(prompt):
 
13
  { "role": "user", "content": prompt }
14
  ]
15
 
16
+ completion = client.chat_completion(messages, max_tokens=100)
 
 
 
 
 
 
17
  response = completion.get("choices")[0].get("message").get("content").replace("```", "").replace("\n", "")
18
 
19
  print(response)