File size: 1,601 Bytes
ae349a5
f5bce5a
9e6aaaa
b3ec6c7
9df64bb
d7512af
b3ec6c7
7ee5088
b3ec6c7
 
5838bc8
e953c6c
1f76b93
 
f3b9d71
b3ec6c7
 
bdf6d7d
c71b9b5
99bed5f
 
2451d98
 
c71b9b5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import json
import gradio as gr
import requests
headers = {"Authorization": f"Bearer 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"}
API_URL = "https://api-inference.huggingface.co/models/PoseyATX/FoxHunterSwift"
def query(payload):
    data = json.dumps(payload)
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))
data = query(
    {
        "parameters": {"max_length": 250, "padding": True,"verbose": False, "repetition_penalty": 10.0, "temperature": 1.0, "use_cache": False},
        "inputs": 
            "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.",
        
    }
)

with gr.Blocks() as demo:
    name = gr.Textbox(label="Paste Your Bill Text In Here:")
    output = gr.Textbox(label="Analysis")
    query_btn = gr.Button("ANALYZE")
    query_btn.click(fn=query, inputs=name, outputs=output)

demo.launch("share=True")