Test streamlit
Browse files- .env +1 -0
- __pycache__/app.cpython-310.pyc +0 -0
- app.py +17 -15
- requirements.txt +4 -8
.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
OPENAI_API_KEY=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
|
__pycache__/app.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
|
|
|
app.py
CHANGED
|
@@ -1,20 +1,22 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
import gradio as gr
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
prompt = PromptTemplate(input_variables=["input"], template="Translate this to French: {input}")
|
| 9 |
-
chain = LLMChain(llm=llm, prompt=prompt)
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import matplotlib.pyplot as plt
|
| 3 |
+
import numpy as np
|
|
|
|
| 4 |
|
| 5 |
+
# 設定頁面標題
|
| 6 |
+
st.title('Monthly Random Numbers Line Chart')
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# 生成隨機數據
|
| 9 |
+
months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
| 10 |
+
data = np.random.randint(0, 100, size=12)
|
| 11 |
|
| 12 |
+
# 畫折線圖
|
| 13 |
+
fig, ax = plt.subplots()
|
| 14 |
+
ax.plot(months, data, marker='o')
|
| 15 |
|
| 16 |
+
# 設置圖表標題和標籤
|
| 17 |
+
ax.set_title('Random Numbers for Each Month')
|
| 18 |
+
ax.set_xlabel('Month')
|
| 19 |
+
ax.set_ylabel('Random Number')
|
| 20 |
|
| 21 |
+
# 顯示圖表
|
| 22 |
+
st.pyplot(fig)
|
requirements.txt
CHANGED
|
@@ -1,12 +1,8 @@
|
|
| 1 |
-
accelerate
|
| 2 |
-
diffusers
|
| 3 |
-
invisible_watermark
|
| 4 |
-
torch
|
| 5 |
-
transformers
|
| 6 |
-
xformers
|
| 7 |
-
gradio
|
| 8 |
-
|
| 9 |
openai
|
| 10 |
langchain
|
| 11 |
gradio
|
| 12 |
langchain_community
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
openai
|
| 2 |
langchain
|
| 3 |
gradio
|
| 4 |
langchain_community
|
| 5 |
+
|
| 6 |
+
streamlit
|
| 7 |
+
matplotlib
|
| 8 |
+
numpy
|