Spaces:
Sleeping
Sleeping
Download app.py from ismetcucen/dil: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/ismetcucen/dil/resolve/main/app.py
- Command line
-
hf download hf://spaces/ismetcucen/dil/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ismetcucen/dil/resolve/main/app.py
664 Bytes
| import gradio as gr | |
| def get_antonym(word): | |
| antonyms = { | |
| "big": "small", | |
| "fast": "slow", | |
| "happy": "sad", | |
| "hot": "cold", | |
| "light": "dark", | |
| "young": "old", | |
| "good": "bad", | |
| "strong": "weak", | |
| "soft": "hard", | |
| "beautiful": "ugly" | |
| } | |
| return antonyms.get(word.lower(), "No antonym found") | |
| iface = gr.Interface( | |
| fn=get_antonym, | |
| inputs=gr.Textbox(label="Enter a word"), | |
| outputs=gr.Textbox(label="Antonym"), | |
| title="Antonym Finder", | |
| description="Enter a word and get its antonym. If the antonym is not available, it will return 'No antonym found'." | |
| ) | |
| iface.launch() |