Spaces:
Running
on
Zero
Running
on
Zero
te
Browse files
controllers/gra_03_programfromdoc/programfromdoc.py
CHANGED
@@ -97,6 +97,7 @@ gradio_interface = gr.Interface(
|
|
97 |
"file",
|
98 |
gr.Textbox(label="Additional Notes", lines=10,value=val),
|
99 |
gr.Textbox(label="Folder Name",value="test_folders"),
|
|
|
100 |
],
|
101 |
outputs="text",
|
102 |
)
|
|
|
97 |
"file",
|
98 |
gr.Textbox(label="Additional Notes", lines=10,value=val),
|
99 |
gr.Textbox(label="Folder Name",value="test_folders"),
|
100 |
+
gr.Textbox(label="github token",value="***********************"),
|
101 |
],
|
102 |
outputs="text",
|
103 |
)
|
mysite/interpreter/process.py
CHANGED
@@ -10,6 +10,7 @@ import async_timeout
|
|
10 |
import asyncio
|
11 |
import mysite.interpreter.interpreter_config
|
12 |
from models.ride import test_set_lide
|
|
|
13 |
|
14 |
GENERATION_TIMEOUT_SEC=60
|
15 |
BASE_PATH = "/home/user/app/controllers/"
|
@@ -66,7 +67,7 @@ def no_process_file(prompt, foldername):
|
|
66 |
|
67 |
|
68 |
|
69 |
-
def process_file(fileobj, prompt, foldername):
|
70 |
set_environment_variables()
|
71 |
try:
|
72 |
proc = subprocess.Popen(["mkdir", f"{BASE_PATH}{foldername}"])
|
@@ -98,7 +99,8 @@ def process_file(fileobj, prompt, foldername):
|
|
98 |
text=True,
|
99 |
)
|
100 |
stdout, stderr = proc.communicate(input="n\ny\ny\n")
|
101 |
-
|
|
|
102 |
except subprocess.CalledProcessError as e:
|
103 |
-
return f"Processed
|
104 |
|
|
|
10 |
import asyncio
|
11 |
import mysite.interpreter.interpreter_config
|
12 |
from models.ride import test_set_lide
|
13 |
+
from mysite.lib.github import github
|
14 |
|
15 |
GENERATION_TIMEOUT_SEC=60
|
16 |
BASE_PATH = "/home/user/app/controllers/"
|
|
|
67 |
|
68 |
|
69 |
|
70 |
+
def process_file(fileobj, prompt, foldername,token=None):
|
71 |
set_environment_variables()
|
72 |
try:
|
73 |
proc = subprocess.Popen(["mkdir", f"{BASE_PATH}{foldername}"])
|
|
|
99 |
text=True,
|
100 |
)
|
101 |
stdout, stderr = proc.communicate(input="n\ny\ny\n")
|
102 |
+
url = github(token)
|
103 |
+
return f"Processed url:{url}\nContent:\n{stdout}\n\nMake Command Output:\n{stdout}\n\nMake Command Error:\n{stderr}"
|
104 |
except subprocess.CalledProcessError as e:
|
105 |
+
return f"Processed url:{url}\nContent:\n{stdout}\n\nMake Command Error:\n{e.stderr}"
|
106 |
|