AFischer1985 commited on
Commit
8cde03d
·
verified ·
1 Parent(s): 81cc898

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -4,7 +4,8 @@ from huggingface_hub import InferenceClient
4
  """
5
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
- client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
 
8
 
9
 
10
  def respond(
@@ -27,17 +28,17 @@ def respond(
27
 
28
  response = ""
29
 
30
- for message in client.chat_completion(
31
- messages,
32
- max_tokens=max_tokens,
33
- stream=True,
34
- temperature=temperature,
35
- top_p=top_p,
36
- ):
37
- token = message.choices[0].delta.content
38
-
39
- response += token
40
- yield response
41
 
42
  """
43
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
4
  """
5
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
+ #client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
+ from gradio_client import Client
9
 
10
 
11
  def respond(
 
28
 
29
  response = ""
30
 
31
+ client = Client("ByteDance/Hyper-SDXL-1Step-T2I")
32
+ result = client.predict(
33
+ num_images=4,
34
+ height=1024,
35
+ width=1024,
36
+ prompt="a photo of a cat",
37
+ seed=3413,
38
+ api_name="/process_image"
39
+ )
40
+ yield(result)
41
+
42
 
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface