Spaces:
Runtime error
Runtime error
carbon
Browse files
app.py
CHANGED
|
@@ -110,6 +110,8 @@ inputs = [
|
|
| 110 |
gr.inputs.Textbox(lines=1, label="Your GitHub API token")
|
| 111 |
]
|
| 112 |
|
|
|
|
|
|
|
| 113 |
# adding carbon support
|
| 114 |
|
| 115 |
GITHUB_API="https://api.github.com"
|
|
@@ -120,7 +122,7 @@ url=GITHUB_API+"/gists"
|
|
| 120 |
#print headers,parameters,payload
|
| 121 |
headers={'Authorization':'token %s'%API_TOKEN}
|
| 122 |
params={'scope':'gist'}
|
| 123 |
-
payload={
|
| 124 |
|
| 125 |
res=requests.post(url,headers=headers,params=params,data=json.dumps(payload))
|
| 126 |
|
|
@@ -130,7 +132,6 @@ if col.button("Create a 'carbon' copy"):
|
|
| 130 |
carbon_url='https://carbon.now.sh/'+res.text.split(',')[0].split('/')[-1][:-1]
|
| 131 |
webbrowser.open_new(carbon_url)
|
| 132 |
|
| 133 |
-
outputs = [gr.outputs.HTML(label="Solution")]
|
| 134 |
|
| 135 |
gr.Interface(
|
| 136 |
generate_solution,
|
|
|
|
| 110 |
gr.inputs.Textbox(lines=1, label="Your GitHub API token")
|
| 111 |
]
|
| 112 |
|
| 113 |
+
outputs = [gr.outputs.HTML(label="Solution")]
|
| 114 |
+
|
| 115 |
# adding carbon support
|
| 116 |
|
| 117 |
GITHUB_API="https://api.github.com"
|
|
|
|
| 122 |
#print headers,parameters,payload
|
| 123 |
headers={'Authorization':'token %s'%API_TOKEN}
|
| 124 |
params={'scope':'gist'}
|
| 125 |
+
payload={outputs[0]}
|
| 126 |
|
| 127 |
res=requests.post(url,headers=headers,params=params,data=json.dumps(payload))
|
| 128 |
|
|
|
|
| 132 |
carbon_url='https://carbon.now.sh/'+res.text.split(',')[0].split('/')[-1][:-1]
|
| 133 |
webbrowser.open_new(carbon_url)
|
| 134 |
|
|
|
|
| 135 |
|
| 136 |
gr.Interface(
|
| 137 |
generate_solution,
|