admin commited on
Commit
81cab4c
·
1 Parent(s): 6860015
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -29,17 +29,12 @@ def infer(longUrl: str):
29
  raise ConnectionError(response.text)
30
 
31
  if is_valid_url(shortUrl):
32
- preview = f"""
33
- {_L("输出短链接")}: <{shortUrl}>
34
- ```txt
35
- {shortUrl}
36
- ```
37
- """
38
 
39
  except Exception as e:
40
  status = f"{e}"
41
 
42
- return status, preview
43
 
44
 
45
  if __name__ == "__main__":
@@ -51,6 +46,7 @@ if __name__ == "__main__":
51
  ),
52
  outputs=[
53
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),
 
54
  gr.Markdown(container=True),
55
  ],
56
  flagging_mode="never",
 
29
  raise ConnectionError(response.text)
30
 
31
  if is_valid_url(shortUrl):
32
+ preview = f"<{shortUrl}>"
 
 
 
 
 
33
 
34
  except Exception as e:
35
  status = f"{e}"
36
 
37
+ return status, shortUrl, preview
38
 
39
 
40
  if __name__ == "__main__":
 
46
  ),
47
  outputs=[
48
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),
49
+ gr.Textbox(label=_L("输出短链接"), show_copy_button=True),
50
  gr.Markdown(container=True),
51
  ],
52
  flagging_mode="never",