Canstralian commited on
Commit
d5d6495
·
verified ·
1 Parent(s): 81b8f16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
 
3
- # URL of the Hugging Face Space
4
- space_url = "https://huggingface.co/spaces/Canstralian/WhiteRabbitNeo"
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 (assuming the model generates a response)
13
- result = interface(prompt)
 
 
14
 
15
- # Print the result (it's likely a string)
16
- print(result)
 
17
 
18
- # Optionally, save the result to a text file
19
- with open("generated_output.txt", "w") as f:
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)