Spaces:
Paused
Paused
Download functions.py from Ufoptg/UFoP-API: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/Ufoptg/UFoP-API/resolve/refs%2Fpr%2F1/functions.py
- Command line
-
hf download hf://spaces/Ufoptg/UFoP-API@refs/pr/1/functions.py
-
curl -L -o functions.py https://huggingface.co/spaces/Ufoptg/UFoP-API/resolve/refs%2Fpr%2F1/functions.py
1.21 kB
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright 2020-2023 (c) Randy W @xtdevs, @xtsea | |
| # | |
| # from : https://github.com/TeamKillerX | |
| # Channel : @RendyProjects | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU Affero General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU Affero General Public License for more details. | |
| # | |
| # You should have received a copy of the GNU Affero General Public License | |
| # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| import requests | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| HUGGING_TOKEN = os.environ["HUGGING_TOKEN"] | |
| SOURCE_ALPHA_URL = os.environ["SOURCE_ALPHA_URL"] | |
| def ryuzaki_ai_text(text): | |
| API_URL = SOURCE_ALPHA_URL | |
| headers = {"Authorization": f"Bearer {HUGGING_TOKEN}"} | |
| response = requests.post(API_URL, headers=headers, json={"inputs": text}) | |
| return response.json() | |