Skip to content

Commit

Permalink
Add models, add expand button
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChristophFH committed May 24, 2024
1 parent e8fd3a4 commit 52a0655
Show file tree
Hide file tree
Showing 71 changed files with 5,806 additions and 46 deletions.
66 changes: 49 additions & 17 deletions components/lms/llm-timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'vis-timeline/styles/vis-timeline-graph2d.css';

import { LLM } from "@/lib/types/llm"
import React from "react";
import { RotateCcw } from "lucide-react";
import { Expand, Minimize2, RotateCcw } from "lucide-react";
import { Button } from "../ui/button";
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "../ui/tooltip";

Expand All @@ -16,37 +16,45 @@ interface Props {
const LlmTimeline: React.FC<Props> = ({ llms, selectCallback }) => {
const container = useRef(null);
const [timeline, setTimeline] = useState<Timeline | null>(null);
const [expanded, setExpanded] = useState(false);

const items: any = llms.map((llm) => {
let now = new Date(); // today
let future = new Date().setDate(now.getDate() + 30); // today + 30 days

const items: any = llms.filter((llm) => !(llm.release_date === "nan")).map((llm) => {
let html = document.createElement("div");
html.appendChild(document.createTextNode(llm.name));
let image = document.createElement("img");
image.src = "logos/" + llm.from + ".svg";
image.style.maxHeight = "1em";
image.style.marginLeft = "0.5em";
image.alt = "";
html.appendChild(image);
html.style.display = "flex";
html.style.alignItems = "center";

let release_date = Date.parse(llm.release_date) ? new Date(llm.release_date) : future;

return ({
id: llm.id,
content: html,
start: llm.release_date,
start: release_date,
data: llm,
});
});

let now = new Date(); // today

const options: any = {
stack: true,
showMajorLabels: true,
showMinorLabels: true,
verticalScroll: true,
zoomKey: "ctrlKey",
maxMinorChars: 4,
minHeight: "400px",
maxHeight: "400px",
start: new Date("2022-01-01"),
end: now.setDate(now.getDate() + 30), // today + 30 days
end: future, // today + 30 days
};

useEffect(() => {
Expand Down Expand Up @@ -74,20 +82,44 @@ const LlmTimeline: React.FC<Props> = ({ llms, selectCallback }) => {
timeline?.setWindow(options.start, options.end);
};

const toggleExpand = () => {
if (expanded) {
timeline?.setOptions({ ...options, minHeight: "400px", maxHeight: "400px" });
setExpanded(false);
} else {
timeline?.setOptions({ ...options, minHeight: "800px", maxHeight: "800px" });
setExpanded(true);
}
}

return (
<div style={{ position: "relative" }}>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" size="icon" style={{ position: "absolute", top: "0.5em", right: "0.5em", zIndex: 5 }} onClick={handleReset}>
<RotateCcw className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent style={{ zIndex: 5 }}>
<p>Reset Zoom</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<div className="absolute top-2 right-2 z-10 flex gap-4">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" size="icon" onClick={handleReset}>
<RotateCcw className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent style={{ zIndex: 5 }}>
<p>Reset Zoom</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" size="icon" onClick={toggleExpand}>
{expanded ? <Minimize2 className="h-4 w-4" /> : <Expand className="h-4 w-4" />}
</Button>
</TooltipTrigger>
<TooltipContent style={{ zIndex: 5 }}>
<p>{expanded ? "Collapse" : "Expand"}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<div ref={container}></div>
</div>
);
Expand Down
43 changes: 43 additions & 0 deletions data/llm/01.ai/yi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "01.ai/yi",
"name": "Yi",
"release_date": "nan",
"from": "01.ai",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "Transformer",
"subtype": "nan",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
43 changes: 43 additions & 0 deletions data/llm/ai21/jamba.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "ai21/jamba",
"name": "Jamba",
"release_date": "nan",
"from": "ai21",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "SMM-Transformer Hybrid",
"subtype": "SSM-Transformer",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
43 changes: 43 additions & 0 deletions data/llm/ai21/jurassic-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "ai21/jurassic-2",
"name": "Jurassic-2",
"release_date": "nan",
"from": "ai21",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "Transformer",
"subtype": "nan",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
43 changes: 43 additions & 0 deletions data/llm/alibaba_cloud/qwen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "alibaba_cloud/qwen",
"name": "Qwen",
"release_date": "nan",
"from": "Alibaba Cloud",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "Transformer",
"subtype": "nan",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
43 changes: 43 additions & 0 deletions data/llm/alibaba_cloud/qwen_1.5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "alibaba_cloud/qwen_1.5",
"name": "Qwen 1.5",
"release_date": "nan",
"from": "Alibaba Cloud",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "Transformer",
"subtype": "nan",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
43 changes: 43 additions & 0 deletions data/llm/anthropic/claude_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"id": "anthropic/claude_1",
"name": "Claude 1",
"release_date": "nan",
"from": "Anthropic",
"usage_type": "GP-LLM",
"description": "",
"readme": {
"link": "",
"raw": ""
},
"model": {
"architecture": "Transformer",
"subtype": "nan",
"insights": [
"nan"
],
"parameters": "nan",
"active_parameters": "nan",
"context_size": "nan",
"tokenizer": "nan",
"hidden_size": "nan",
"vocab_size": "nan",
"positional_embedding": "nan",
"attention_variant": "nan",
"activation": "nan"
},
"training": {
"tokens": "nan"
},
"license": "nan",
"license_url": "nan",
"download": "nan",
"paper": "nan",
"bonus": [
{
"type": "",
"title": "",
"url": ""
}
],
"updated": "2024-05-24"
}
Loading

0 comments on commit 52a0655

Please sign in to comment.