SpyC0der77 commited on
Commit
e920afb
·
verified ·
1 Parent(s): 7fca778

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  import os
4
  from datetime import datetime
 
5
 
6
 
7
  client = InferenceClient("EvanZhouDev/open-genmoji", token=os.getenv("HUGGINGFACE_API_TOKEN"))
@@ -34,7 +35,7 @@ def process(prompt):
34
  image = client.text_to_image(response)
35
  image.save("outputs/images/" + time + ".png")
36
  with open("outputs/" + time + ".json", "wb") as f:
37
- f.write({"prompt": prompt, "refined_prompt": response, "image": "outputs/images/" + time + ".png"})
38
  return image
39
 
40
  # Create a Gradio Blocks app
 
2
  from huggingface_hub import InferenceClient
3
  import os
4
  from datetime import datetime
5
+ import json
6
 
7
 
8
  client = InferenceClient("EvanZhouDev/open-genmoji", token=os.getenv("HUGGINGFACE_API_TOKEN"))
 
35
  image = client.text_to_image(response)
36
  image.save("outputs/images/" + time + ".png")
37
  with open("outputs/" + time + ".json", "wb") as f:
38
+ f.write(json.dumps({"prompt": prompt, "refined_prompt": response, "image": "outputs/images/" + time + ".png"}))
39
  return image
40
 
41
  # Create a Gradio Blocks app