Download index.html from TAIRED/Ai: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/spaces/TAIRED/Ai/resolve/main/index.html
- Command line
-
hf download hf://spaces/TAIRED/Ai/index.html
-
curl -L -o index.html https://huggingface.co/spaces/TAIRED/Ai/resolve/main/index.html
1.75 kB
| <html> | |
| <head> | |
| <script type="module" src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" /> | |
| <title>Uncensored AI & Image Generator</title> | |
| </head> | |
| <body> | |
| <gradio-lite> | |
| <gradio-requirements> | |
| huggingface_hub | |
| </gradio-requirements> | |
| <gradio-file name="app.py" entrypoint> | |
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| text_client = InferenceClient("failspy/Llama-3-8B-Instruct-Abliterated") | |
| image_client = InferenceClient("black-forest-labs/FLUX.1-schnell") | |
| def chat(message, history): | |
| if any(k in message.lower() for k in ["draw", "image of", "generate image"]): | |
| p = message.replace("draw", "").replace("generate image of", "").replace("image of", "").strip() | |
| try: | |
| img = image_client.text_to_image(p) | |
| return [("Here is your image:", img)] | |
| except Exception: | |
| return [("Image generation failed.", None)] | |
| try: | |
| res = "" | |
| for token in text_client.chat_completion([{"role": "user", "content": message}], stream=True): | |
| res += token.choices[0].delta.content | |
| return [(res, None)] | |
| except Exception: | |
| return [("Could not reach model.", None)] | |
| with gr.Blocks() as demo: | |
| gr.Markdown("### Uncensored Chat & Image Maker") | |
| b = gr.Chatbot() | |
| m = gr.Textbox(placeholder="Talk or type 'draw [description]'...") | |
| def respond(usr, hist): | |
| out = chat(usr, hist) | |
| hist.append((usr, out[0][0])) | |
| if out[0][1]: | |
| hist.append((None, out[0][1])) | |
| return "", hist | |
| m.submit(respond, [m, b], [m, b]) | |
| demo.launch() | |
| </gradio-file> | |
| </gradio-lite> | |
| </body> | |
| </html> | |