stillerman commited on
Commit
957e7cc
·
1 Parent(s): d10cc3f

small changes

Browse files
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: Wikispeedia
3
- emoji: 🐳
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: docker
 
1
  ---
2
+ title: WikiRacing Language Models
3
+ emoji: 🏃
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: docker
results/popular_nodes.json ADDED
@@ -0,0 +1 @@
 
 
1
+ ["Dimmu Borgir", "Battle of Qazvin (1230)", "Lawyer", "Entertainment One Distribution", "Iraq", "Magnetic moment", "List of sovereign states", "Philadelphia", "Simpson and Delilah", "Honduras", "2019 CONCACAF Gold Cup", "Lausanne", "Agust\u00edn Gamarra", "Leo Minor", "Big Bang", "1998\u201399 Manchester United F.C. season", "Excalibur", "Costa Rica", "Austria", "Camorino", "The Verdict", "Brislach", "Reith im Alpbachtal", "Shai Hulud (band)", "Alice in Chains", "313", "Joroinen", "Animation", "R (programming language)", "America's Army", "Li\u00e8ge (province)", "2020 United States Census", "Muhammad Al-Munajjid", "Jellyfish", "Poland", "Saudi Arabia", "Verdana", "May 7", "Yellowstone (American TV series)", "Colombia", "Andrew Lincoln", "Departments of France", "Priest Holmes", "Langlade County, Wisconsin", "England", "Estonia", "Chicago", "Coypu", "Crime in India", "2021\u201322 UEFA Champions League qualifying phase and play-off round", "MBC Drama (Middle East and North Africa)", "Dalai Lama", "Rubber Soul", "Anguilla", "Soilwork", "2022 FIFA World Cup qualification \u2013 AFC First Round", "Lukas Gugganig", "September 3", "Association football", "Canal+", "Iannis Xenakis", "1977", "Counties of Iran", "Canal+", "Toholampi", "Eastern Bloc", "Academy Award", "Eiffel Tower", "Amrish Puri", "Michael Cole", "George Plimpton", "\u00c9cole Polytechnique massacre", "Hubble's law", "Japan", "Newcastle upon Tyne", "1800 United States presidential election", "Aude", "Hebrew language", "Vice-President of Ghana", "London Underground", "Loir-et-Cher", "Leonding", "Courfaivre", "Division of East Sydney", "Eastern European Time", "Willem Dafoe", "Toy Story 3", "Azerbaijani language", "List of Australian Leaders of the Opposition", "Eutheria", "Grenville, Grenada", "UEFA Euro 2000 qualifying", "Anopheles", "Afghanistan", "Peter Plympton Smith", "The Young Bucks", "Riniken", "The Jungle Book", "Tony Snow", "Shivaji", "General Electric Company plc", "Johnny Gosch", "Chicago Fire (TV series)", "Mount Everest", "Venus of Berekhat Ram", "Democratic Party (United States)", "Dan (rank)", "Pas-de-Calais", "Newgrounds", "Central European Time", "Joshua Kimmich", "2019\u201320 Bundesliga", "Nevada", "Europe", "SeaTac, Washington", "Montaigu-Vend\u00e9e", "UEFA Euro 2012", "Sweden", "Kansas", "West Sussex", "Chinese language", "Roddy McDowall", "Sydney", "Miley Cyrus", "New England", "List of Atlantic hurricane seasons", "List of professional wrestling terms", "Bound for Glory IV", "Montreal", "Inside Out (2015 movie)", "Saffarid dynasty", "The Paynes", "Order of the British Empire", "Auvergne-Rh\u00f4ne-Alpes", "RAID", "Sastamala", "Ancient Greece", "Regions of France", "Mitsubishi ASX", "Minnesota", "Malala Yousafzai", "Iran", "Saudi Arabia", "List of Sam & Cat episodes", "Neustadt (Aisch)-Bad Windsheim", "Singapore", "Cara\u0219-Severin County", "Nauru", "Warner Bros. Records", "Toronto Maple Leafs", "Alternative rock", "Discworld", "Pencil", "April 1", "Baltimore Ravens", "Warner Bros. Discovery Americas", "Dust Bowl", "Italy", "Animal", "Czech Republic", "Angela Valdes", "Norway", "Native American", "National Hockey League", "Woods of Ypres", "Province of Ancona", "Sony", "Sea turtle", "Eurovision Song Contest 2018", "Synagogue", "East Punjab", "Annecy-le-Vieux", "Rock music", "George Clinton (musician)", "Warner Bros. Discovery Americas", "Eco-socialism", "Collonge-Bellerive", "Pope John Paul II", "Cham (district)", "Major League baseball", "Michael Botticelli", "200", "France T\u00e9l\u00e9visions", "Maguindanao del Sur", "Holy Roman Empire", "Katerini", "Monterrey", "Munji language", "Serbia", "British Rail", "Mary Poppins Returns", "Leibstadt", "Angels of the Silences", "Europe", "Ishikawa Prefecture", "Angelique Rockas", "Province of Sassari", "Semitic languages", "Bromic acid", "United States Census Bureau", "1907", "Turkey", "Armenia", "Arkady Ter-Tadevosyan", "Lesotho", "The Witches (2020 movie)", "South America", "Parliament of Tasmania", "Anahita", "List of professional wrestling terms", "Hertfordshire", "M\u00f6riken-Wildegg", "7 November", "Personal union", "COVID-19", "Indiana", "Marrakesh", "2021 New Orleans Saints season", "2010 FIFA World Cup", "PlayStation 4", "Chicago Bears", "Pennsylvania", "Communes of France", "Izanagi", "Brooklyn", "Asuel", "Lemanu Peleti Mauga", "Kathleen Wynne", "Elizabeth Montgomery", "Don Rickles", "Dark Rainbow", "Bleach (manga)", "Botterens", "Harald Hardrada", "The Golden Girls", "Super OS", "2014\u201315 Eredivisie", "Discworld", "United States", "Westminster School", "Charter Oak, California", "List of rulers of Saxony", "San Francisco 49ers", "Communes of France", "Baden-W\u00fcrttemberg", "Amber Rudd", "Hawaii", "Sankt Urban", "Florida", "Am\u00e9rico", "Carl Stumpf", "Sulfur", "Iannis Xenakis", "Bill Stone", "Wildest Dreams (song)", "List of Russian-language novelists", "Rancho Mirage, California", "Chelsea Girl", "New York City Subway", "People's Republic of China", "Love. Angel. Music. Baby.", "Upper Saxon German", "Cry Wolf (A-ha song)", "Ascoli Piceno", "England", "Arrondissement of Pau", "Caribbean", "List of sovereign states", "Siege of Nishapur (1221)", "Australia", "Breakbeat", "Joseph Joffo", "Solol\u00e1 Department", "Tibetan Book of the Dead", "Bipolar disorder", "Denbighshire (historic)", "Public university", "Boba Fett", "Yelawolf", "UEFA Euro 2000 qualifying", "RAID", "Ted Kennedy", "English language", "2020 Iowa Democratic caucuses", "Louisa May Alcott", "Andretti Autosport", "Le Chenit", "Trento", "South West Africa", "Regions of France", "Poland", "Baddies season 2", "European Union", "J\u014dwa (Heian period)", "Cognac (commune)", "Communes of France", "Cantonese language", "Aaahh!!! Real Monsters", "Leslie Bricusse", "Ferdinand Swatosch", "1999", "2021\u201322 UEFA Champions League knockout phase", "New Jersey Legislature", "Bobby Hull", "MBC Drama (Middle East and North Africa)", "Bleeding Kansas", "Dotted and dotless I", "Hungarian Grand Prix", "Scotland", "Pays de la Loire", "Netherlands", "Auvergne-Rh\u00f4ne-Alpes", "Fencing at the 1900 Summer Olympics \u2013 Men's \u00e9p\u00e9e", "Smash (album)", "Jellyfish", "Benin", "American Airlines Flight 77", "Castries", "List of rulers of Saxony", "Azerbaijani language", "PlayStation 4", "Nepenthes", "Saint Croix, U.S. Virgin Islands", "Secretary of State", "Aklan", "Christian", "Normandy", "New York City", "Messina", "J. R. R. Tolkien", "Governor of Victoria", "Uzi", "Zeus", "Dan (rank)", "Lancashire", "Lake Sevan", "National Archives and Records Administration", "Qasim ibn Muhammad", "List of WWE pay-per-view events", "Judah (Biblical personage)", "Brisbane", "Caroline County, Maryland", "Martine Aubry", "PPSh-41", "Bon Jovi", "Lam Lai", "Allmusic", "Nature reserve", "Grey DeLisle", "List of Italian painters", "Vinci, Tuscany", "City", "Ten Commandments", "Ada Yonath", "Innsbruck-Land District", "Kingdom of Hanover", "Asian Americans", "Annihilator", "Mercedes-Benz T2", "National Hockey League", "Academia Europaea", "Muppets from Space", "Elwin Ransom", "List of sovereign states", "Space Shuttle Columbia", "BDSM", "Amsterdam", "Civic Opera Building", "Viersen", "Guillaume, Hereditary Grand Duke of Luxembourg", "Bipolar disorder", "DYSS-TV", "Bhatayakorn School", "Soviet Union", "Thirst (1961 movie)", "KCPQ", "Haruo Arima", "China", "Christian Mortensen", "List of Doctor Who producers", "Electronic dance music", "United States Census Bureau", "Johannes Kert", "2002\u201303 NHL season", "Miguel de Cervantes Prize", "Lausanne", "English language", "Graub\u00fcnden", "Warsaw", "Pontedera", "Eurypterus", "Malala Yousafzai", "Cantons of Switzerland", "Herbert von Karajan", "Imee Marcos", "Can I Play with Madness", "Univision Communications", "Democratic Party (United States)", "Association football", "Americans", "Scotland", "Capital of Japan", "Gr\u00fcsch", "South African Grand Prix", "Pioneer 10", "Pincer movement", "The Undertaker", "Sacramento Kings", "Turbocharger", "World Tag Team Championship (WWE)", "BBC", "Aar\u00f3n Hern\u00e1n", "DYSS-TV", "Celle (district)", "Area 51", "Scottie Upshall", "Spanish language", "2015 UEFA European Under-21 Championship", "Cuban Missile Crisis", "Azerbaijani language", "Mohammad Javad Zarif", "People (magazine)", "People Got To Be Free", "Benjamin Franklin", "City of Manchester Stadium", "United States", "Uttarakhand", "David Koresh", "Basel", "List of literary terms", "Ronald Reagan", "July 29", "Colombia", "1901", "England national under-21 football team", "Expressionism", "Alberta", "United States Secretary of Defense", "1916", "Pencil", "Japan", "Kabul River", "Roh Tae-woo", "Bregenz (district)", "EFL Cup", "Limburg (Belgium)", "Tokyo", "Pok\u00e9mon Red and Blue", "Communes of France", "McLaren Grand Prix results", "Holy Roman Empire", "Ginuwine", "CNN", "Xumo", "Bouches-du-Rh\u00f4ne", "Saudi Arabia", "Johann Palisa", "Geographic Names Information System", "Nigeria", "Leopold Grundwald", "Huffman coding", "Judgment Day (2003)", "Los Angeles", "President of Iran", "Santa Mar\u00eda Apaxco", "Peugeot", "Natalie Portman", "Prime Minister", "Zaza Urushadze", "Amazon (company)", "2003", "England", "American Gigolo", "Wild Orchid (movie)", "Moscow", "Wichita, Kansas", "Mixtape Messiah", "Jeff Bennett", "Berchtesgadener Land", "Province of Vicenza", "Bob Marley", "DYSS-TV", "Battle of Qazvin (1230)", "Chairperson of the African Union", "Cugy, Fribourg", "\u00c9amon de Valera", "Sarthe", "Parides", "Chef Boyardee", "Paris", "Chairperson of the African Union", "Machiko Hasegawa", "Padua", "Zeus", "Timberview High School shooting", "UEFA European Under-19 Championship", "Ren\u00e9 Pr\u00e9val", "Karakoram", "Phil LaMarr", "Canal+"]
src/App.tsx CHANGED
@@ -20,7 +20,7 @@ export default function Home() {
20
  return (
21
  <div className="container mx-auto p-4">
22
  <div className="flex flex-row justify-between">
23
- <h1 className="text-3xl font-bold mb-6">Wikispeedia</h1>
24
  <SignInWithHuggingFaceButton />
25
  </div>
26
 
 
20
  return (
21
  <div className="container mx-auto p-4">
22
  <div className="flex flex-row justify-between">
23
+ <h1 className="text-3xl font-bold mb-6">WikiRacing Language Models</h1>
24
  <SignInWithHuggingFaceButton />
25
  </div>
26
 
src/components/about-tab.tsx CHANGED
@@ -17,7 +17,7 @@ export default function AboutTab() {
17
  </CardHeader>
18
  <CardContent className="space-y-4">
19
  <p>
20
- Wikispeedia (also known as the Wikipedia Game, WikiRace, or WikiClick) is a game where players race to navigate from
21
  one Wikipedia article to another using only the hyperlinks within each article. The goal is to reach the target
22
  article in the fewest clicks or in the shortest time.
23
  </p>
 
17
  </CardHeader>
18
  <CardContent className="space-y-4">
19
  <p>
20
+ WikiRacing (also known as the Wikipedia Game, Wikispeedia, or WikiClick) is a game where players race to navigate from
21
  one Wikipedia article to another using only the hyperlinks within each article. The goal is to reach the target
22
  article in the fewest clicks or in the shortest time.
23
  </p>
src/components/game-component.tsx CHANGED
@@ -113,6 +113,7 @@ export default function GameComponent({
113
  "playing"
114
  );
115
  const [continuousPlay, setContinuousPlay] = useState<boolean>(false);
 
116
 
117
  const [convo, setConvo] = useState<Message[]>([]);
118
  const [expandedMessages, setExpandedMessages] = useState<Record<number, boolean>>({});
@@ -257,14 +258,14 @@ export default function GameComponent({
257
 
258
  // Effect for continuous play mode
259
  useEffect(() => {
260
- if (continuousPlay && player === "model" && gameStatus === "playing" && modelStatus !== "thinking" && !linksLoading) {
261
  const timer = setTimeout(() => {
262
  makeModelMove();
263
  }, 1000);
264
 
265
  return () => clearTimeout(timer);
266
  }
267
- }, [continuousPlay, player, gameStatus, modelStatus, linksLoading, currentPage]);
268
 
269
  return (
270
  <div className="grid grid-cols-1 md:grid-cols-12 gap-2 h-[calc(100vh-200px)] grid-rows-[auto_1fr]">
@@ -305,21 +306,34 @@ export default function GameComponent({
305
  <>
306
  {player === "model" && (
307
  <>
308
- <Button
309
- onClick={makeModelMove}
310
- disabled={modelStatus === "thinking" || linksLoading}
311
- size="sm"
312
- className="h-8"
313
- >
314
- Make Move
315
- </Button>
 
 
 
 
 
 
 
 
 
 
316
 
317
  <div className="flex items-center gap-1 ml-1">
318
  <Switch
319
  id="continuous-play"
320
  checked={continuousPlay}
321
- onCheckedChange={setContinuousPlay}
322
- disabled={modelStatus === "thinking" || linksLoading}
 
 
 
323
  />
324
  <Label htmlFor="continuous-play" className="text-xs">
325
  Auto
 
113
  "playing"
114
  );
115
  const [continuousPlay, setContinuousPlay] = useState<boolean>(false);
116
+ const [autoRunning, setAutoRunning] = useState<boolean>(true);
117
 
118
  const [convo, setConvo] = useState<Message[]>([]);
119
  const [expandedMessages, setExpandedMessages] = useState<Record<number, boolean>>({});
 
258
 
259
  // Effect for continuous play mode
260
  useEffect(() => {
261
+ if (continuousPlay && autoRunning && player === "model" && gameStatus === "playing" && modelStatus !== "thinking" && !linksLoading) {
262
  const timer = setTimeout(() => {
263
  makeModelMove();
264
  }, 1000);
265
 
266
  return () => clearTimeout(timer);
267
  }
268
+ }, [continuousPlay, autoRunning, player, gameStatus, modelStatus, linksLoading, currentPage]);
269
 
270
  return (
271
  <div className="grid grid-cols-1 md:grid-cols-12 gap-2 h-[calc(100vh-200px)] grid-rows-[auto_1fr]">
 
306
  <>
307
  {player === "model" && (
308
  <>
309
+ {continuousPlay ? (
310
+ <Button
311
+ onClick={() => setAutoRunning(!autoRunning)}
312
+ size="sm"
313
+ className="h-8"
314
+ >
315
+ {autoRunning ? "Stop" : "Start"}
316
+ </Button>
317
+ ) : (
318
+ <Button
319
+ onClick={makeModelMove}
320
+ disabled={modelStatus === "thinking" || linksLoading}
321
+ size="sm"
322
+ className="h-8"
323
+ >
324
+ Next Move
325
+ </Button>
326
+ )}
327
 
328
  <div className="flex items-center gap-1 ml-1">
329
  <Switch
330
  id="continuous-play"
331
  checked={continuousPlay}
332
+ onCheckedChange={(checked) => {
333
+ setContinuousPlay(checked);
334
+ if (!checked) setAutoRunning(false);
335
+ }}
336
+ disabled={(modelStatus === "thinking" || linksLoading) || (continuousPlay && autoRunning)}
337
  />
338
  <Label htmlFor="continuous-play" className="text-xs">
339
  Auto
src/components/play-tab.tsx CHANGED
@@ -10,7 +10,9 @@ import GameComponent from "@/components/game-component";
10
  import {
11
  Select,
12
  SelectContent,
 
13
  SelectItem,
 
14
  SelectTrigger,
15
  SelectValue,
16
  } from "@/components/ui/select";
@@ -24,6 +26,7 @@ import {
24
  TooltipTrigger,
25
  } from "@/components/ui/tooltip";
26
  import { Separator } from "@/components/ui/separator";
 
27
 
28
  export default function PlayTab({
29
  startArticle,
@@ -33,14 +36,16 @@ export default function PlayTab({
33
  destinationArticle?: string;
34
  }) {
35
  const [player, setPlayer] = useState<"me" | "model">("me");
36
- const [selectedModel, setSelectedModel] = useState<string | undefined>();
 
 
37
  const [maxHops, setMaxHops] = useState<number>(20);
38
  const [isGameStarted, setIsGameStarted] = useState<boolean>(false);
39
- const [startPage, setStartPage] = useState<string>(startArticle || "Dogs");
40
  const [targetPage, setTargetPage] = useState<string>(
41
- destinationArticle || "Canada"
42
  );
43
- const [maxTokens, setMaxTokens] = useState<number>(1024);
44
  const [maxLinks, setMaxLinks] = useState<number>(200);
45
  const [isServerConnected, setIsServerConnected] = useState<boolean>(false);
46
  const [modelList, setModelList] = useState<
@@ -96,7 +101,7 @@ export default function PlayTab({
96
 
97
  const fetchAvailableModels = async () => {
98
  const response = await fetch(
99
- "https://huggingface.co/api/models?inference_provider=all&pipeline_tag=text-generation"
100
  );
101
  const models = await response.json();
102
  const filteredModels = models.filter((m: { tags: string[] }) =>
@@ -111,14 +116,13 @@ export default function PlayTab({
111
  name: m.id.split("/")[1],
112
  })
113
  );
114
- console.log("got model list", modelList);
115
  setModelList(modelList);
116
  };
117
 
118
  const selectRandomArticle = (setter: (article: string) => void) => {
119
- if (allArticles.length > 0) {
120
- const randomIndex = Math.floor(Math.random() * allArticles.length);
121
- setter(allArticles[randomIndex]);
122
  }
123
  };
124
 
@@ -218,11 +222,14 @@ export default function PlayTab({
218
  />
219
  </SelectTrigger>
220
  <SelectContent>
221
- {modelList.map((model) => (
222
- <SelectItem key={model.id} value={model.id}>
223
- {model.id}
224
- </SelectItem>
225
- ))}
 
 
 
226
  </SelectContent>
227
  </Select>
228
  </div>
@@ -273,7 +280,8 @@ export default function PlayTab({
273
  <TooltipContent>
274
  <p className="max-w-xs">
275
  Maximum number of links the model can consider
276
- per page.
 
277
  </p>
278
  </TooltipContent>
279
  </Tooltip>
 
10
  import {
11
  Select,
12
  SelectContent,
13
+ SelectGroup,
14
  SelectItem,
15
+ SelectLabel,
16
  SelectTrigger,
17
  SelectValue,
18
  } from "@/components/ui/select";
 
26
  TooltipTrigger,
27
  } from "@/components/ui/tooltip";
28
  import { Separator } from "@/components/ui/separator";
29
+ import popularNodes from "../../results/popular_nodes.json";
30
 
31
  export default function PlayTab({
32
  startArticle,
 
36
  destinationArticle?: string;
37
  }) {
38
  const [player, setPlayer] = useState<"me" | "model">("me");
39
+ const [selectedModel, setSelectedModel] = useState<string | undefined>(
40
+ "deepseek-ai/DeepSeek-V3-0324"
41
+ );
42
  const [maxHops, setMaxHops] = useState<number>(20);
43
  const [isGameStarted, setIsGameStarted] = useState<boolean>(false);
44
+ const [startPage, setStartPage] = useState<string>(startArticle || "Capybara");
45
  const [targetPage, setTargetPage] = useState<string>(
46
+ destinationArticle || "Pokémon"
47
  );
48
+ const [maxTokens, setMaxTokens] = useState<number>(3000);
49
  const [maxLinks, setMaxLinks] = useState<number>(200);
50
  const [isServerConnected, setIsServerConnected] = useState<boolean>(false);
51
  const [modelList, setModelList] = useState<
 
101
 
102
  const fetchAvailableModels = async () => {
103
  const response = await fetch(
104
+ "https://huggingface.co/api/models?inference_provider=hyperbolic&pipeline_tag=text-generation"
105
  );
106
  const models = await response.json();
107
  const filteredModels = models.filter((m: { tags: string[] }) =>
 
116
  name: m.id.split("/")[1],
117
  })
118
  );
 
119
  setModelList(modelList);
120
  };
121
 
122
  const selectRandomArticle = (setter: (article: string) => void) => {
123
+ if (popularNodes.length > 0) {
124
+ const randomIndex = Math.floor(Math.random() * popularNodes.length);
125
+ setter(popularNodes[randomIndex]);
126
  }
127
  };
128
 
 
222
  />
223
  </SelectTrigger>
224
  <SelectContent>
225
+ <SelectGroup>
226
+ <SelectLabel>Hyperbolic</SelectLabel>
227
+ {modelList.map((model) => (
228
+ <SelectItem key={model.id} value={model.id}>
229
+ {model.id}
230
+ </SelectItem>
231
+ ))}
232
+ </SelectGroup>
233
  </SelectContent>
234
  </Select>
235
  </div>
 
280
  <TooltipContent>
281
  <p className="max-w-xs">
282
  Maximum number of links the model can consider
283
+ per page. Small models tend to get stuck if this
284
+ is too high.
285
  </p>
286
  </TooltipContent>
287
  </Tooltip>