Spaces:
Sleeping
Sleeping
| # ************************************************** | |
| # import os | |
| # import gradio | |
| # os.system(command="cls") | |
| # print(f"Version of 'gradio': {gradio.__version__}") | |
| # ************************************************** | |
| # ************************************************** | |
| # import os | |
| # import gradio as gr | |
| # def greet(name: str) -> str: | |
| # """ | |
| # A simple greeting function. | |
| # """ | |
| # result: str = f"Hello, {name}!" | |
| # return result | |
| # os.system(command="cls") | |
| # # Error! missing 2 required positional arguments: 'inputs' and 'outputs' | |
| # # interface = gr.Interface(fn=greet) | |
| # interface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| # interface.launch() | |
| # ************************************************** | |
| # ************************************************** | |
| # import os | |
| # import gradio as gr | |
| # def greet(name: str) -> str: | |
| # """ | |
| # A simple greeting function. | |
| # """ | |
| # result: str = f"Hello, {name}!" | |
| # return result | |
| # os.system(command="cls") | |
| # interface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| # interface.launch() | |
| # ************************************************** | |
| # ************************************************** | |
| import os | |
| import gradio as gr | |
| def greet(name: str) -> str: | |
| """ | |
| A simple greeting function. | |
| """ | |
| result: str = f"Hello, {name}!" | |
| return result | |
| os.system(command="cls") | |
| # NEW: flagging_mode="never" | |
| interface = gr.Interface(fn=greet, inputs="text", outputs="text", flagging_mode="never") | |
| interface.launch() | |
| # ************************************************** | |
| # ************************************************** | |
| # import os | |
| # import gradio as gr | |
| # def greet(name: str) -> str: | |
| # """ | |
| # A simple greeting function. | |
| # """ | |
| # result: str = f"Hello, {name}!" | |
| # print(f"When 'share=True', The app will be run in your computer. {result}") | |
| # return result | |
| # os.system(command="cls") | |
| # interface = gr.Interface(fn=greet, inputs="text", outputs="text", flagging_mode="never") | |
| # # NEW: share=True | |
| # interface.launch(share=True) | |
| # ************************************************** | |
| # Could not create share link. Please check your internet connection or our status page: https://status.gradio.app. | |
| # | |
| # Solution: | |
| # | |
| # 1. Press Windows key > Search for "Windows Security" > Open | |
| # 2. Select: "App & browser control" | |
| # 3. Select: "Review" in "Reputation-based protection" | |
| # 4. Select: "Potentially unwanted apps" | |
| # 5. Select: "Actions" | |
| # 6. Select: "Allow on device" | |
| # ************************************************** | |
| # Deploy: | |
| # | |
| # 1. https://huggingface.co/settings/tokens | |
| # 2. https://huggingface.co/new-space | |
| # 3. https://huggingface.co/DariushTasdighi | |
| # 4. | |
| # 5. gradio deploy | |
| # ************************************************** | |