htohfa commited on
Commit
8860e2b
·
1 Parent(s): fcb02e5

changes for hugging face

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -1,8 +1,6 @@
1
  import sys
2
  import time
3
  from pathlib import Path
4
- import os
5
-
6
  sys.path.insert(0, str(Path(__file__).parent))
7
 
8
  import streamlit as st
@@ -109,17 +107,11 @@ with col_left:
109
  model_label = st.selectbox("Model", options=MODEL_LABELS, label_visibility="collapsed")
110
 
111
  st.markdown('<p class="section-label" style="margin-top:1.2rem;">Anthropic API Key</p>', unsafe_allow_html=True)
112
- api_key = st.text_input(
113
- "Anthropic API Key", type="password", label_visibility="collapsed",
114
- placeholder="sk-ant-...",
115
- value=os.environ.get("ANTHROPIC_API_KEY", ""),
116
- )
117
  st.markdown('<p class="section-label" style="margin-top:0.8rem;">Semantic Scholar Key (optional)</p>', unsafe_allow_html=True)
118
- s2_key = st.text_input(
119
- "S2 Key", type="password", label_visibility="collapsed",
120
- placeholder="(Recommended for keyword fallback)",
121
- value=os.environ.get("S2_API_KEY", ""),
122
- )
123
  st.markdown('<p class="section-label" style="margin-top:1.5rem;">Describe the figure</p>', unsafe_allow_html=True)
124
  user_text = st.text_area(
125
  "Figure description", label_visibility="collapsed", height=120,
@@ -147,10 +139,9 @@ with col_left:
147
  if use_pathfinder:
148
  st.markdown('<p class="section-label" style="margin-top:0.6rem;">OpenAI API Key</p>', unsafe_allow_html=True)
149
  openai_key = st.text_input(
150
- "OpenAI Key", type="password", label_visibility="collapsed",
151
- placeholder="sk-...",
152
- value=os.environ.get("OPENAI_API_KEY", ""),
153
- )
154
  st.markdown(
155
  '<p style="font-size:0.78rem;color:#888;margin-top:-0.4rem;">'
156
  'Used to embed queries with text-embedding-3-small (~$0.40 per million queries).'
 
1
  import sys
2
  import time
3
  from pathlib import Path
 
 
4
  sys.path.insert(0, str(Path(__file__).parent))
5
 
6
  import streamlit as st
 
107
  model_label = st.selectbox("Model", options=MODEL_LABELS, label_visibility="collapsed")
108
 
109
  st.markdown('<p class="section-label" style="margin-top:1.2rem;">Anthropic API Key</p>', unsafe_allow_html=True)
110
+ api_key = st.text_input("Anthropic API Key", type="password", label_visibility="collapsed", placeholder="sk-ant-...")
111
+
 
 
 
112
  st.markdown('<p class="section-label" style="margin-top:0.8rem;">Semantic Scholar Key (optional)</p>', unsafe_allow_html=True)
113
+ s2_key = st.text_input("S2 Key", type="password", label_visibility="collapsed", placeholder="(Recommended for keyword fallback)")
114
+
 
 
 
115
  st.markdown('<p class="section-label" style="margin-top:1.5rem;">Describe the figure</p>', unsafe_allow_html=True)
116
  user_text = st.text_area(
117
  "Figure description", label_visibility="collapsed", height=120,
 
139
  if use_pathfinder:
140
  st.markdown('<p class="section-label" style="margin-top:0.6rem;">OpenAI API Key</p>', unsafe_allow_html=True)
141
  openai_key = st.text_input(
142
+ "OpenAI Key", type="password", label_visibility="collapsed",
143
+ placeholder="sk-...",
144
+ )
 
145
  st.markdown(
146
  '<p style="font-size:0.78rem;color:#888;margin-top:-0.4rem;">'
147
  'Used to embed queries with text-embedding-3-small (~$0.40 per million queries).'