Spaces:
Sleeping
Sleeping
Download app2.py from pmv-hou/linkedin_post_generator: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/pmv-hou/linkedin_post_generator/resolve/main/app2.py
- Command line
-
hf download hf://spaces/pmv-hou/linkedin_post_generator/app2.py
-
curl -L -o app2.py https://huggingface.co/spaces/pmv-hou/linkedin_post_generator/resolve/main/app2.py
493 Bytes
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| import os | |
| API_TOKEN = os.environ['HF_TOKEN'] | |
| client = InferenceClient() | |
| def query(payload): | |
| response = client.text_generation(payload, model="google/gemma-7b", max_new_tokens=12) | |
| return response #.json() | |
| text_generation_interface = gr.Interface( | |
| fn=query, | |
| inputs=[ | |
| gr.Textbox(label="Input Text"), | |
| ], | |
| outputs=gr.Textbox(label="Generated Text"), | |
| title="google/gemma-7b", | |
| ).launch() |