Spaces:
Runtime error
Runtime error
deploy at 2024-08-21 16:39:13.928105
Browse files- main.py +4 -13
- space_exploration_timeline.csv +10 -11
- timeline.csv +13 -13
main.py
CHANGED
@@ -1,25 +1,16 @@
|
|
1 |
from fasthtml_hf import setup_hf_backup
|
2 |
-
from timelinestyle import TimelineStyle
|
3 |
import os
|
4 |
-
import json
|
5 |
import pandas as pd
|
6 |
import traceback
|
7 |
-
import wikipedia
|
8 |
from datetime import datetime
|
9 |
from typing import Literal
|
10 |
-
from
|
11 |
-
from
|
12 |
from langchain_core.prompts import PromptTemplate
|
13 |
-
from langchain.chains import LLMChain
|
14 |
from langchain.output_parsers import PydanticOutputParser
|
15 |
-
from langchain.chains.summarize import load_summarize_chain
|
16 |
from langchain_openai import ChatOpenAI
|
17 |
from langchain_anthropic import ChatAnthropic
|
18 |
-
from pydantic import BaseModel, Field, ValidationError
|
19 |
-
from langchain_openai import ChatOpenAI
|
20 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
21 |
-
from fasthtml.common import *
|
22 |
-
from fasthtml.components import Svg
|
23 |
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
|
24 |
from langchain_community.tools.wikipedia.tool import WikipediaQueryRun
|
25 |
|
@@ -212,11 +203,11 @@ def getConfigForm():
|
|
212 |
Select(Option("OpenAI Gpt-4o"), Option("Anthropic Claude"), Option("Google Gemini"), id="model", cls = 'select w-full max-w-xs')
|
213 |
),
|
214 |
Div(
|
215 |
-
Span(Strong('
|
216 |
Input(id="secret", type="password", placeholder="Key: "),
|
217 |
),
|
218 |
Div(
|
219 |
-
Span(Strong('
|
220 |
Input(type = 'text',
|
221 |
id="topic",
|
222 |
cls = "input w-full max-w-xs",
|
|
|
1 |
from fasthtml_hf import setup_hf_backup
|
|
|
2 |
import os
|
|
|
3 |
import pandas as pd
|
4 |
import traceback
|
|
|
5 |
from datetime import datetime
|
6 |
from typing import Literal
|
7 |
+
from pydantic import BaseModel, Field
|
8 |
+
from fasthtml.common import *
|
9 |
from langchain_core.prompts import PromptTemplate
|
|
|
10 |
from langchain.output_parsers import PydanticOutputParser
|
|
|
11 |
from langchain_openai import ChatOpenAI
|
12 |
from langchain_anthropic import ChatAnthropic
|
|
|
|
|
13 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
|
|
|
14 |
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
|
15 |
from langchain_community.tools.wikipedia.tool import WikipediaQueryRun
|
16 |
|
|
|
203 |
Select(Option("OpenAI Gpt-4o"), Option("Anthropic Claude"), Option("Google Gemini"), id="model", cls = 'select w-full max-w-xs')
|
204 |
),
|
205 |
Div(
|
206 |
+
Span(Strong('API Key: '), cls ="badge"),
|
207 |
Input(id="secret", type="password", placeholder="Key: "),
|
208 |
),
|
209 |
Div(
|
210 |
+
Span(Strong('Topic for timeline (Person/Organization/Event): '), cls ="badge"),
|
211 |
Input(type = 'text',
|
212 |
id="topic",
|
213 |
cls = "input w-full max-w-xs",
|
space_exploration_timeline.csv
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
,index,Time,Event,Sentiment,TimeStr
|
2 |
-
0,0,1957-10-04,
|
3 |
-
1,1,1961-04-12,
|
4 |
-
2,
|
5 |
-
3,
|
6 |
-
4,
|
7 |
-
5,5,
|
8 |
-
6,
|
9 |
-
7,
|
10 |
-
8,
|
11 |
-
9,
|
12 |
-
10,10,2024-06-01,"SpaceX's Starship completed its fourth test flight, reaching space and returning both stages.",Positive,01/06/2024
|
|
|
1 |
,index,Time,Event,Sentiment,TimeStr
|
2 |
+
0,0,1957-10-04 00:00:00+00:00,Launch of Sputnik 1 by Soviet Union,Positive,04/10/1957
|
3 |
+
1,1,1961-04-12 00:00:00+00:00,First human spaceflight by Yuri Gagarin,Positive,12/04/1961
|
4 |
+
2,2,1965-03-18 00:00:00+00:00,First spacewalk by Alexei Leonov,Positive,18/03/1965
|
5 |
+
3,3,1969-07-20 00:00:00+00:00,First Moon landing by Apollo 11,Positive,20/07/1969
|
6 |
+
4,4,1971-04-19 00:00:00+00:00,Launch of first space station Salyut 1,Positive,19/04/1971
|
7 |
+
5,5,2011-03-09 00:00:00+00:00,Completion of ISS following STS-133,Positive,09/03/2011
|
8 |
+
6,9,2020-01-01 00:00:00+00:00,Starlink becomes largest satellite constellation,Positive,01/01/2020
|
9 |
+
7,6,2022-11-16 00:00:00+00:00,First mission of Artemis Program,Positive,16/11/2022
|
10 |
+
8,7,2023-04-20 00:00:00+00:00,First flight of SpaceX Starship,Positive,20/04/2023
|
11 |
+
9,8,2024-06-15 00:00:00+00:00,Starship completes test flight with splashdown,Positive,15/06/2024
|
|
timeline.csv
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
2,
|
5 |
-
3,
|
6 |
-
4,
|
7 |
-
5,
|
8 |
-
6,
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
1 |
+
index,Time,Event
|
2 |
+
1,1957-01-01 00:00:00+00:00,Soviet Union sends first living being into orbit.
|
3 |
+
0,1957-10-04 00:00:00+00:00,"Soviet Union launches Sputnik 1, the first human-made object to orbit Earth."
|
4 |
+
2,1961-01-01 00:00:00+00:00,Yuri Gagarin aboard Vostok 1 becomes the first human in space.
|
5 |
+
3,1965-03-18 00:00:00+00:00,Alexei Leonov performs the first spacewalk.
|
6 |
+
4,1966-01-01 00:00:00+00:00,First automatic landing on another celestial body achieved.
|
7 |
+
5,1969-07-20 00:00:00+00:00,American Apollo 11 mission lands on the Moon.
|
8 |
+
6,1971-01-01 00:00:00+00:00,"Launch of Salyut 1, the first space station."
|
9 |
+
10,2000-01-01 00:00:00+00:00,China initiates successful crewed spaceflight program.
|
10 |
+
11,2000-01-01 00:00:00+00:00,India launches Chandrayaan programme for lunar exploration.
|
11 |
+
8,2009-01-01 00:00:00+00:00,Expert review panel judges Constellation program unrealistic.
|
12 |
+
7,2011-03-01 00:00:00+00:00,Substantial completion of the International Space Station following STS-133.
|
13 |
+
9,2022-01-01 00:00:00+00:00,First Artemis Program mission occurs.
|