reach-vb HF staff commited on
Commit
e63fb58
·
verified ·
1 Parent(s): 5f61b41

Update app.py (#20)

Browse files

- Update app.py (5506f78493e27b1d535e3e160b704e70c300587e)

Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -82,16 +82,12 @@ def process_image_tag(image_tag, repo_id, oauth_token: Union[gr.OAuthToken, None
82
  # Delete the blobs folder
83
  shutil.rmtree('blobs')
84
 
85
- return f'Find your repo <a href=\'{repo_path}\' target="_blank" style="text-decoration:underline">here</a>'
86
 
87
  except Exception as e:
88
  shutil.rmtree('blobs', ignore_errors=True)
89
 
90
- return f"We got an error, my dude, here's what the error looks like: {str(e)}"
91
-
92
- css = """
93
- .main_ui_logged_out{opacity: 0.3; pointer-events: none}
94
- """
95
 
96
  # Create the Gradio interface using gr.Blocks
97
  with gr.Blocks() as demo:
@@ -106,7 +102,7 @@ with gr.Blocks() as demo:
106
  result_output = gr.Markdown(label="Result")
107
 
108
  process_button = gr.Button("Process")
109
- process_button.click(fn=process_image_tag, inputs=[image_tag_input, repo_id_input], outputs=result_output)
110
 
111
  # Launch the Gradio app
112
  demo.launch()
 
82
  # Delete the blobs folder
83
  shutil.rmtree('blobs')
84
 
85
+ return (f'Find your repo <a href=\'{repo_path}\' target="_blank" style="text-decoration:underline">here</a>', "dramallama.jpg")
86
 
87
  except Exception as e:
88
  shutil.rmtree('blobs', ignore_errors=True)
89
 
90
+ return (f"We got an error, my dude, here's what the error looks like: {str(e)}", "madllama.jpg")
 
 
 
 
91
 
92
  # Create the Gradio interface using gr.Blocks
93
  with gr.Blocks() as demo:
 
102
  result_output = gr.Markdown(label="Result")
103
 
104
  process_button = gr.Button("Process")
105
+ process_button.click(fn=process_image_tag, inputs=[image_tag_input, repo_id_input], outputs=[result_output, gr.Image(show_label=False)])
106
 
107
  # Launch the Gradio app
108
  demo.launch()