Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
-
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
Function to query Hugging Face API
|
4 |
|
5 |
def query_huggingface_api(prompt, api_url, api_key): headers = {"Authorization": f"Bearer {api_key}"} payload = {"inputs": prompt} response = requests.post(api_url, headers=headers, json=payload)
|
6 |
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import json
|
4 |
|
5 |
+
###Function to query Hugging Face API
|
6 |
|
7 |
def query_huggingface_api(prompt, api_url, api_key): headers = {"Authorization": f"Bearer {api_key}"} payload = {"inputs": prompt} response = requests.post(api_url, headers=headers, json=payload)
|
8 |
|