Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# **************************************************
|
| 2 |
+
# import os
|
| 3 |
+
# import gradio
|
| 4 |
+
|
| 5 |
+
# os.system(command="cls")
|
| 6 |
+
|
| 7 |
+
# print(f"Version of 'gradio': {gradio.__version__}")
|
| 8 |
+
# **************************************************
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
# **************************************************
|
| 12 |
+
# import os
|
| 13 |
+
# import gradio as gr
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
# def greet(name: str) -> str:
|
| 17 |
+
# """
|
| 18 |
+
# A simple greeting function.
|
| 19 |
+
# """
|
| 20 |
+
|
| 21 |
+
# result: str = f"Hello, {name}!"
|
| 22 |
+
|
| 23 |
+
# return result
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
# os.system(command="cls")
|
| 27 |
+
|
| 28 |
+
# # Error! missing 2 required positional arguments: 'inputs' and 'outputs'
|
| 29 |
+
# # interface = gr.Interface(fn=greet)
|
| 30 |
+
|
| 31 |
+
# interface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 32 |
+
# interface.launch()
|
| 33 |
+
# **************************************************
|
| 34 |
+
|
| 35 |
+
# **************************************************
|
| 36 |
+
# import os
|
| 37 |
+
# import gradio as gr
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
# def greet(name: str) -> str:
|
| 41 |
+
# """
|
| 42 |
+
# A simple greeting function.
|
| 43 |
+
# """
|
| 44 |
+
|
| 45 |
+
# result: str = f"Hello, {name}!"
|
| 46 |
+
|
| 47 |
+
# return result
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
# os.system(command="cls")
|
| 51 |
+
|
| 52 |
+
# interface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 53 |
+
# interface.launch()
|
| 54 |
+
# **************************************************
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
# **************************************************
|
| 58 |
+
import os
|
| 59 |
+
import gradio as gr
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def greet(name: str) -> str:
|
| 63 |
+
"""
|
| 64 |
+
A simple greeting function.
|
| 65 |
+
"""
|
| 66 |
+
|
| 67 |
+
result: str = f"Hello, {name}!"
|
| 68 |
+
|
| 69 |
+
return result
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
os.system(command="cls")
|
| 73 |
+
|
| 74 |
+
# NEW: flagging_mode="never"
|
| 75 |
+
interface = gr.Interface(fn=greet, inputs="text", outputs="text", flagging_mode="never")
|
| 76 |
+
interface.launch()
|
| 77 |
+
# **************************************************
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
# **************************************************
|
| 81 |
+
# import os
|
| 82 |
+
# import gradio as gr
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
# def greet(name: str) -> str:
|
| 86 |
+
# """
|
| 87 |
+
# A simple greeting function.
|
| 88 |
+
# """
|
| 89 |
+
|
| 90 |
+
# result: str = f"Hello, {name}!"
|
| 91 |
+
# print(f"When 'share=True', The app will be run in your computer. {result}")
|
| 92 |
+
|
| 93 |
+
# return result
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
# os.system(command="cls")
|
| 97 |
+
|
| 98 |
+
# interface = gr.Interface(fn=greet, inputs="text", outputs="text", flagging_mode="never")
|
| 99 |
+
|
| 100 |
+
# # NEW: share=True
|
| 101 |
+
# interface.launch(share=True)
|
| 102 |
+
# **************************************************
|
| 103 |
+
# Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.
|
| 104 |
+
#
|
| 105 |
+
# Solution:
|
| 106 |
+
#
|
| 107 |
+
# 1. Press Windows key > Search for "Windows Security" > Open
|
| 108 |
+
# 2. Select: "App & browser control"
|
| 109 |
+
# 3. Select: "Review" in "Reputation-based protection"
|
| 110 |
+
# 4. Select: "Potentially unwanted apps"
|
| 111 |
+
# 5. Select: "Actions"
|
| 112 |
+
# 6. Select: "Allow on device"
|
| 113 |
+
# **************************************************
|
| 114 |
+
# Deploy:
|
| 115 |
+
#
|
| 116 |
+
# 1. https://huggingface.co/settings/tokens
|
| 117 |
+
# 2. https://huggingface.co/new-space
|
| 118 |
+
# 3. https://huggingface.co/DariushTasdighi
|
| 119 |
+
# 4.
|
| 120 |
+
# 5. gradio deploy
|
| 121 |
+
# **************************************************
|