Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
#
|
4 |
-
space_url = "
|
5 |
|
6 |
# Connect to the Space
|
7 |
interface = gr.Interface.load(space_url)
|
@@ -9,12 +9,14 @@ interface = gr.Interface.load(space_url)
|
|
9 |
# Prompt to generate code and sentences
|
10 |
prompt = "A new bug bounty to solve"
|
11 |
|
12 |
-
# Get the generated result
|
13 |
-
|
|
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
f.write(result)
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Identifier of the Hugging Face Space
|
4 |
+
space_url = "Canstralian/WhiteRabbitNeo"
|
5 |
|
6 |
# Connect to the Space
|
7 |
interface = gr.Interface.load(space_url)
|
|
|
9 |
# Prompt to generate code and sentences
|
10 |
prompt = "A new bug bounty to solve"
|
11 |
|
12 |
+
# Get the generated result
|
13 |
+
try:
|
14 |
+
result = interface(prompt) # Ensure the interface supports string input and output
|
15 |
+
print("Generated Result:", result)
|
16 |
|
17 |
+
# Optionally, save the result to a text file
|
18 |
+
with open("generated_output.txt", "w") as f:
|
19 |
+
f.write(result)
|
20 |
|
21 |
+
except Exception as e:
|
22 |
+
print("An error occurred:", e)
|
|