Spaces:
Sleeping
Sleeping
Commit
·
f36e7ac
1
Parent(s):
a991681
added app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import gradio as gr
|
|
| 11 |
|
| 12 |
hf_api_key = "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"
|
| 13 |
|
| 14 |
-
API_URL = "https://api-inference.huggingface.co/models/
|
| 15 |
|
| 16 |
# Summarization endpoint
|
| 17 |
|
|
@@ -31,8 +31,9 @@ def get_completion(inputs, parameters=None, ENDPOINT_URL=API_URL):
|
|
| 31 |
|
| 32 |
|
| 33 |
def summarize(input):
|
| 34 |
-
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
demo = gr.Interface(fn=summarize, inputs=
|
| 38 |
[gr.Textbox(label="Skriv inn tekst", lines = 6)],
|
|
|
|
| 11 |
|
| 12 |
hf_api_key = "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"
|
| 13 |
|
| 14 |
+
API_URL = "https://api-inference.huggingface.co/models/donadelicc/nor-sum"
|
| 15 |
|
| 16 |
# Summarization endpoint
|
| 17 |
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
def summarize(input):
|
| 34 |
+
prefix = "summarize: "
|
| 35 |
+
output = get_completion(prefix+input)
|
| 36 |
+
return output[0]['generated_text']
|
| 37 |
|
| 38 |
demo = gr.Interface(fn=summarize, inputs=
|
| 39 |
[gr.Textbox(label="Skriv inn tekst", lines = 6)],
|