Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import json
|
|
5 |
API_URL = "https://api.openai.com/v1/chat/completions"
|
6 |
|
7 |
def predict(inputs, top_p, temperature, openai_api_key):
|
8 |
-
narration_prompt = f"๋์์์ ์ฌ์ฉํ ์ ๋ฌธ์ ์ธ ๋๋ ์ด์
์ ์์ฑํ๋ผ. ๋ฐ๋์ ํ๊ธ๋ก ์์ฑํ ๊ฒ. ์ผ์ฒด์ ์ง๋ฌธ์ด๋ ์ง์, ๋ฐฐ๊ฒฝ ์ค๋ช
๋ฑ์ ๋
ธ์ถ ํ๊ฑฐ๋ ์ถ๋ ฅํ์ง ๋ง๊ณ ์์ํ ๋๋ ์ด์
๋ง 2์ค์ฉ ๋ฌถ์ด์ ์ต๋
|
9 |
|
10 |
headers = {
|
11 |
"Content-Type": "application/json",
|
@@ -47,7 +47,9 @@ with gr.Blocks() as demo:
|
|
47 |
["์ ๋ณด ๊ณต์ : ๋นํ๋ฏผC ๊ณผ๋ค ๋ณต์ฉ์ ๊ฑด๊ฐ์ ์คํ๋ ค ํด๋กญ๋ค."],
|
48 |
["ํ๋ณด: 'OpenAI'๋ '์ฑGPT'์ ๋ง์ถค GPT '์คํ ์ด'๋ฅผ ์คํํ์๋ค."],
|
49 |
["์ธ์ฌ: '์ ํ ๋ฒ์ธ'์ ๊ณ ๊ฐ๊ณผ ์์ง์์ ์ํ ์ง์ทจ์ ์ธ 2024๋
์ ๋
์ธ์ฌ"],
|
50 |
-
["https://aitechtree.wordpress.com/2023/11/24/state-department-harnesses-ai-potential-unleashing-real-time-insights-and-leading-ethical-adoption-worldwide/ ์ด url์ post๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ผ"]
|
|
|
|
|
51 |
], inputs=[inputs], fn=predict, outputs=output)
|
52 |
|
53 |
demo.launch()
|
|
|
5 |
API_URL = "https://api.openai.com/v1/chat/completions"
|
6 |
|
7 |
def predict(inputs, top_p, temperature, openai_api_key):
|
8 |
+
narration_prompt = f"๋์์์ ์ฌ์ฉํ ์ ๋ฌธ์ ์ธ ๋๋ ์ด์
์ ์์ฑํ๋ผ. ๋ฐ๋์ ํ๊ธ๋ก ์์ฑํ ๊ฒ. ์ผ์ฒด์ ์ง๋ฌธ์ด๋ ์ง์, ๋ฐฐ๊ฒฝ ์ค๋ช
๋ฑ์ ๋
ธ์ถ ํ๊ฑฐ๋ ์ถ๋ ฅํ์ง ๋ง๊ณ ์์ํ ๋๋ ์ด์
๋ง 2์ค์ฉ ๋ฌถ์ด์ ์ต๋ 20์ค ์ด๋ด๋ก ์ถ๋ ฅ๋ ฅ. ์
๋ ฅ: '{inputs}'"
|
9 |
|
10 |
headers = {
|
11 |
"Content-Type": "application/json",
|
|
|
47 |
["์ ๋ณด ๊ณต์ : ๋นํ๋ฏผC ๊ณผ๋ค ๋ณต์ฉ์ ๊ฑด๊ฐ์ ์คํ๋ ค ํด๋กญ๋ค."],
|
48 |
["ํ๋ณด: 'OpenAI'๋ '์ฑGPT'์ ๋ง์ถค GPT '์คํ ์ด'๋ฅผ ์คํํ์๋ค."],
|
49 |
["์ธ์ฌ: '์ ํ ๋ฒ์ธ'์ ๊ณ ๊ฐ๊ณผ ์์ง์์ ์ํ ์ง์ทจ์ ์ธ 2024๋
์ ๋
์ธ์ฌ"],
|
50 |
+
["https://aitechtree.wordpress.com/2023/11/24/state-department-harnesses-ai-potential-unleashing-real-time-insights-and-leading-ethical-adoption-worldwide/ ์ด url์ post๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ผ"],
|
51 |
+
["https://www.amazon.com/Cuckoo-CRP-RT0609FB-Pressure-Scorched-Options/dp/B087H24T6G?ref_=Oct_DLandingS_D_d34e1017_2&th=1/ ์ด ์๋ง์กด ์ผํ url์ ์ํ์ ๋ณด๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ผ"],
|
52 |
+
["https://medium.com/@thakermadhav/build-your-own-rag-with-mistral-7b-and-langchain-97d0c92fa146/ ์ด ๋ธ๋ก๊ทธ url์ post๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ผ"]
|
53 |
], inputs=[inputs], fn=predict, outputs=output)
|
54 |
|
55 |
demo.launch()
|