Spaces:
Runtime error
Runtime error
seawolf2357
commited on
Commit
โข
bd6df30
1
Parent(s):
2f47bc7
initial commit
Browse files
app.py
CHANGED
@@ -43,25 +43,23 @@ def flip_text(request, page_url, contraseรฑa, temp):
|
|
43 |
return page.text, "--- Max number of tokens ---", num_tokens
|
44 |
|
45 |
|
46 |
-
def greet(name):
|
47 |
-
return "Hello " + name + "!"
|
48 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
49 |
-
|
50 |
-
|
51 |
# define the gradio interface
|
52 |
iface = gr.Interface(
|
53 |
fn=flip_text,
|
54 |
inputs=[gr.Textbox(lines=1, placeholder="๋ถ์ํ๋ผ:", label="ํ๋กฌํํธ:", type="text"),
|
55 |
gr.Textbox(lines=1, placeholder="URL์ ๋ถ์ฌ ๋ฃ์ผ์ธ์: ", label="URL ๋ถ์ฌ๋ฃ๊ธฐ:", type="text"),
|
56 |
gr.Textbox(lines=1, placeholder="์น์ธ๋ API-key๋ฅผ ์
๋ ฅํ์ธ์.", label="API-Key:", type="password"),
|
57 |
-
gr.Slider(0.0,1.0, value=0.
|
58 |
],
|
59 |
outputs=[gr.Textbox(label="Input:"), gr.Textbox(label="Output:"), gr.Textbox(label="Tokens:")],
|
60 |
examples=[["๊ธฐ์ฌ๋ฅผ ์์ฝํ๋ผ:","http://korating.com/news/view.php?idx=7573","",0.7],
|
61 |
["ํ๊ธ๋ก ๋ฒ์ญํ๋ผ:\n- ์์ฝ:\n- ๋น์ฆ๋์ค ์ํฅ๋:\n- ํฌ์ ๊ฐ์น:", "https://ai.googleblog.com/2019/10/quantum-supremacy-using-programmable.html","",0.7],
|
62 |
["์ข
๋ชฉ ๋ถ์ ์์ฝํ๋ผ:","https://securities.miraeasset.com/bbs/board/message/view.do?messageId=2297456&messageNumber=492&messageCategoryId=0&startId=zzzzz%7E&startPage=1&curPage=1&searchType=2&searchText=&searchStartYear=2022&searchStartMonth=02&searchStartDay=01&searchEndYear=2023&searchEndMonth=02&searchEndDay=01&lastPageFlag=&vf_headerTitle=&categoryId=1545","",0.7]
|
63 |
],
|
64 |
-
|
|
|
|
|
|
|
65 |
# description="This tool allows querying the text retrieved from the URL using OpenAI's [text-davinci-003] engine.\nThe URL text can be referenced in the prompt as \"following text\".\nA GPT2 tokenizer is included to ensure that the 2000 token limit for OpenAI queries is not exceeded. Provide a prompt with your request, the url for text retrieval, your api-key and temperature to process the text."
|
66 |
)
|
67 |
|
|
|
43 |
return page.text, "--- Max number of tokens ---", num_tokens
|
44 |
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
# define the gradio interface
|
47 |
iface = gr.Interface(
|
48 |
fn=flip_text,
|
49 |
inputs=[gr.Textbox(lines=1, placeholder="๋ถ์ํ๋ผ:", label="ํ๋กฌํํธ:", type="text"),
|
50 |
gr.Textbox(lines=1, placeholder="URL์ ๋ถ์ฌ ๋ฃ์ผ์ธ์: ", label="URL ๋ถ์ฌ๋ฃ๊ธฐ:", type="text"),
|
51 |
gr.Textbox(lines=1, placeholder="์น์ธ๋ API-key๋ฅผ ์
๋ ฅํ์ธ์.", label="API-Key:", type="password"),
|
52 |
+
gr.Slider(0.0,1.0, value=0.7, label="Temperature:")
|
53 |
],
|
54 |
outputs=[gr.Textbox(label="Input:"), gr.Textbox(label="Output:"), gr.Textbox(label="Tokens:")],
|
55 |
examples=[["๊ธฐ์ฌ๋ฅผ ์์ฝํ๋ผ:","http://korating.com/news/view.php?idx=7573","",0.7],
|
56 |
["ํ๊ธ๋ก ๋ฒ์ญํ๋ผ:\n- ์์ฝ:\n- ๋น์ฆ๋์ค ์ํฅ๋:\n- ํฌ์ ๊ฐ์น:", "https://ai.googleblog.com/2019/10/quantum-supremacy-using-programmable.html","",0.7],
|
57 |
["์ข
๋ชฉ ๋ถ์ ์์ฝํ๋ผ:","https://securities.miraeasset.com/bbs/board/message/view.do?messageId=2297456&messageNumber=492&messageCategoryId=0&startId=zzzzz%7E&startPage=1&curPage=1&searchType=2&searchText=&searchStartYear=2022&searchStartMonth=02&searchStartDay=01&searchEndYear=2023&searchEndMonth=02&searchEndDay=01&lastPageFlag=&vf_headerTitle=&categoryId=1545","",0.7]
|
58 |
],
|
59 |
+
|
60 |
+
<iframe src="https://huggingface.co/spaces/seawolf2357/PDF-text-extractor"></iframe>
|
61 |
+
|
62 |
+
title="ํ๊ธ ๋ฐ ๋ค๊ตญ์ด ์ง์ + ChatGPT + ๋ฉํฐ ๋ชจ๋ธ๋ง ๊ธฐ๋ฐ ์์ฉ AI",
|
63 |
# description="This tool allows querying the text retrieved from the URL using OpenAI's [text-davinci-003] engine.\nThe URL text can be referenced in the prompt as \"following text\".\nA GPT2 tokenizer is included to ensure that the 2000 token limit for OpenAI queries is not exceeded. Provide a prompt with your request, the url for text retrieval, your api-key and temperature to process the text."
|
64 |
)
|
65 |
|