Spaces:
Runtime error
Runtime error
Download app.py from davidlopez/Intro-Python-Tutor: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/davidlopez/Intro-Python-Tutor/resolve/850b06adc626a12eaaa747d52df203288560cb6f/app.py
- Command line
-
hf download hf://spaces/davidlopez/Intro-Python-Tutor@850b06adc626a12eaaa747d52df203288560cb6f/app.py
-
curl -L -o app.py https://huggingface.co/spaces/davidlopez/Intro-Python-Tutor/resolve/850b06adc626a12eaaa747d52df203288560cb6f/app.py
523 Bytes
| import json | |
| import os | |
| import gradio as gr | |
| os.environ['OPENAI_API_KEY']=os.getenv('OpenAI_KEY') | |
| os.environ["LANGCHAIN_API_KEY"]=os.getenv('LANGCHAIN_API_KEY') | |
| os.environ["LANGCHAIN_TRACING_V2"]="true" | |
| os.environ["LANGCHAIN_ENDPOINT"]="https://api.smith.langchain.com" | |
| os.environ["LANGCHAIN_PROJECT"]="disinformation-assistant" | |
| def greet(name, intensity): | |
| return "hi there " + name + "!" * int(intensity) | |
| demo = gr.Interface( | |
| fn=greet, | |
| inputs=["text", "slider"], | |
| outputs=["text"], | |
| ) | |
| demo.launch() |