lalashechka commited on
Commit
1b815f3
1 Parent(s): 9da9910

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -51,8 +51,22 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
51
  return result[0][0]['image']
52
 
53
  if task == "OpenDalle v1.1":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  opendalle = str(os.getenv("opendalle"))
55
- client = Client(opendalle, hf_token=hf_token)
56
  result = client.predict(prompt, "", "", "", False, False, False, 999, 1024, 1024, 5, 5, 25, 25, False, api_name="/run")
57
  return result
58
 
 
51
  return result[0][0]['image']
52
 
53
  if task == "OpenDalle v1.1":
54
+ headers = {
55
+ 'authority': 'mrfakename-opendallev1-1-gpu-demo.hf.space',
56
+ 'accept': 'text/event-stream',
57
+ 'accept-language': 'ru,en;q=0.9,la;q=0.8,ja;q=0.7',
58
+ 'cache-control': 'no-cache',
59
+ 'referer': 'https://mrfakename-opendallev1-1-gpu-demo.hf.space/?__theme=light',
60
+ 'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "YaBrowser";v="24.1", "Yowser";v="2.5"',
61
+ 'sec-ch-ua-mobile': '?0',
62
+ 'sec-ch-ua-platform': '"Windows"',
63
+ 'sec-fetch-dest': 'empty',
64
+ 'sec-fetch-mode': 'cors',
65
+ 'sec-fetch-site': 'same-origin',
66
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36',
67
+ }
68
  opendalle = str(os.getenv("opendalle"))
69
+ client = Client(opendalle, headers=headers)
70
  result = client.predict(prompt, "", "", "", False, False, False, 999, 1024, 1024, 5, 5, 25, 25, False, api_name="/run")
71
  return result
72