fsfgdsgdfgsdfg commited on
Commit
26b493a
·
verified ·
1 Parent(s): 94edc0b

Upload 8 files

Browse files
Files changed (4) hide show
  1. Dockerfile +17 -17
  2. deno.json +2 -2
  3. src/layouts/layout.tsx +1 -1
  4. src/main.tsx +91 -91
Dockerfile CHANGED
@@ -1,17 +1,17 @@
1
- FROM denoland/deno:latest
2
-
3
- EXPOSE 7860
4
-
5
- WORKDIR /app
6
-
7
- # Prefer not to run as root.
8
- USER deno
9
-
10
- RUN deno install
11
-
12
- COPY . .
13
-
14
- # Compile the main app so that it doesn't need to be compiled each startup/entry.
15
- RUN deno cache src/main.tsx
16
-
17
- CMD ["task", "start"]
 
1
+ FROM denoland/deno:latest
2
+
3
+ EXPOSE 7860
4
+
5
+ WORKDIR /app
6
+
7
+ # Prefer not to run as root.
8
+ USER deno
9
+
10
+ RUN deno install
11
+
12
+ COPY . .
13
+
14
+ # Compile the main app so that it doesn't need to be compiled each startup/entry.
15
+ RUN deno cache src/main.tsx
16
+
17
+ CMD ["task", "start"]
deno.json CHANGED
@@ -3,13 +3,13 @@
3
  "start": "deno --allow-net --allow-read --allow-env --env-file=.env --unstable-cron --watch src/main.tsx"
4
  },
5
  "imports": {
6
- "hono": "jsr:@hono/hono@^4.7.1",
7
  "@std/async": "jsr:@std/async@^1.0.11",
8
  "@std/random": "jsr:@std/random@^0.1.0"
9
  },
10
  "compilerOptions": {
11
  "jsx": "precompile",
12
- "jsxImportSource": "hono/jsx"
13
  },
14
  "lock": false,
15
  "fmt": {
 
3
  "start": "deno --allow-net --allow-read --allow-env --env-file=.env --unstable-cron --watch src/main.tsx"
4
  },
5
  "imports": {
6
+ "@hono/hono": "jsr:@hono/hono@^4.7.1",
7
  "@std/async": "jsr:@std/async@^1.0.11",
8
  "@std/random": "jsr:@std/random@^0.1.0"
9
  },
10
  "compilerOptions": {
11
  "jsx": "precompile",
12
+ "jsxImportSource": "@hono/hono/jsx"
13
  },
14
  "lock": false,
15
  "fmt": {
src/layouts/layout.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import type { FC } from 'hono/jsx';
2
 
3
  export const Layout: FC = (props) => {
4
  return (
 
1
+ import type { FC } from '@hono/hono/jsx';
2
 
3
  export const Layout: FC = (props) => {
4
  return (
src/main.tsx CHANGED
@@ -1,91 +1,91 @@
1
- import { Hono } from '@hono/hono';
2
- import { logger } from '@hono/hono/logger';
3
- import { serveStatic } from '@hono/hono/deno';
4
- import { Layout } from './layouts/layout.tsx';
5
- import { getLatestVideo } from './lucinda.ts';
6
- import { HuggingFace } from './huggingface.ts';
7
-
8
- const app = new Hono();
9
-
10
- let counter = 0;
11
-
12
- app.use(logger());
13
-
14
- app.use('/static/*', serveStatic({ root: './' }));
15
-
16
- app.get('/', async (c) => {
17
- counter++;
18
- console.log('Counter:', counter);
19
-
20
- let video: string;
21
- try {
22
- video = await getLatestVideo();
23
- } catch (e) {
24
- console.error(e);
25
- video = 'srs1dXyAoTQ';
26
- }
27
- return c.html(
28
- <Layout>
29
- <header>
30
- <div class='visitor-counter'>Visitors: {counter}</div>
31
- <h1>Artificial General Intelligence</h1>
32
- <div class='subtitle'>Understanding the Future of AI</div>
33
- </header>
34
- <div class='container'>
35
- <div class='video-container'>
36
- <iframe src={`https://www.youtube.com/embed/${video}?autoplay=1`} frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
37
- </div>
38
- <section class='intro-text'>
39
- <h2>What is Artificial General Intelligence?</h2>
40
- <p>Artificial General Intelligence (AGI) refers to highly autonomous systems that outperform humans at most economically valuable work. Unlike narrow AI systems designed for specific tasks, AGI aims to possess the ability to understand, learn, and apply knowledge across a wide range of domains—similar to human intelligence.</p>
41
- <p>The development of AGI represents one of the most profound technological challenges and opportunities of our time, with potential impacts across virtually every aspect of human society.</p>
42
- </section>
43
- <section class='key-points'>
44
- <div class='point-card'>
45
- <h3>Key Characteristics</h3>
46
- <p>AGI systems would demonstrate human-like capabilities including:</p>
47
- <ul>
48
- <li>Abstract reasoning</li>
49
- <li>Transfer learning across domains</li>
50
- <li>Natural language understanding</li>
51
- <li>Adaptability to new situations</li>
52
- <li>Problem-solving without specific programming</li>
53
- </ul>
54
- </div>
55
- <div class='point-card'>
56
- <h3>Current Progress</h3>
57
- <p>While we have made significant advances in AI with large language models and multimodal systems, true AGI remains a future goal. Current systems excel in specific domains but lack the generality, robustness, and adaptability that define AGI.</p>
58
- <p>Researchers are exploring various pathways including scaling existing architectures, developing more sample-efficient learning methods, and incorporating causal reasoning.</p>
59
- </div>
60
- <div class='point-card'>
61
- <h3>Ethical Considerations</h3>
62
- <p>The development of AGI raises important questions about:</p>
63
- <ul>
64
- <li>Alignment with human values</li>
65
- <li>Safety and control mechanisms</li>
66
- <li>Equitable distribution of benefits</li>
67
- <li>Impact on labor markets and society</li>
68
- <li>Governance frameworks for advanced AI</li>
69
- </ul>
70
- </div>
71
- </section>
72
- </div>
73
- </Layout>,
74
- );
75
- });
76
-
77
- app.post('/', (c) => c.text('ok'));
78
-
79
- Deno.serve({ port: 7860 }, app.fetch);
80
-
81
- Deno.cron('follow', '0 0 * * *', async () => {
82
- const hf = new HuggingFace(Deno.env.get('HF_COOKIE')!);
83
- const count = await hf.followRandomUsers('meta-llama');
84
- console.log('Number of users followed:', count);
85
- });
86
-
87
- Deno.cron('test', '0 * * * *', async () => {
88
- const host = 'https://' + Deno.env.get('SPACE_HOST');
89
- const res = await fetch(host, { method: 'POST' });
90
- console.log(await res.text());
91
- });
 
1
+ import { Hono } from '@hono/hono';
2
+ import { logger } from '@hono/hono/logger';
3
+ import { serveStatic } from '@hono/hono/deno';
4
+ import { Layout } from './layouts/layout.tsx';
5
+ import { getLatestVideo } from './lucinda.ts';
6
+ import { HuggingFace } from './huggingface.ts';
7
+
8
+ const app = new Hono();
9
+
10
+ let counter = 0;
11
+
12
+ app.use(logger());
13
+
14
+ app.use('/static/*', serveStatic({ root: './' }));
15
+
16
+ app.get('/', async (c) => {
17
+ counter++;
18
+ console.log('Counter:', counter);
19
+
20
+ let video: string;
21
+ try {
22
+ video = await getLatestVideo();
23
+ } catch (e) {
24
+ console.error(e);
25
+ video = 'srs1dXyAoTQ';
26
+ }
27
+ return c.html(
28
+ <Layout>
29
+ <header>
30
+ <div class='visitor-counter'>Visitors: {counter}</div>
31
+ <h1>Artificial General Intelligence</h1>
32
+ <div class='subtitle'>Understanding the Future of AI</div>
33
+ </header>
34
+ <div class='container'>
35
+ <div class='video-container'>
36
+ <iframe src={`https://www.youtube.com/embed/${video}?autoplay=1`} frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
37
+ </div>
38
+ <section class='intro-text'>
39
+ <h2>What is Artificial General Intelligence?</h2>
40
+ <p>Artificial General Intelligence (AGI) refers to highly autonomous systems that outperform humans at most economically valuable work. Unlike narrow AI systems designed for specific tasks, AGI aims to possess the ability to understand, learn, and apply knowledge across a wide range of domains—similar to human intelligence.</p>
41
+ <p>The development of AGI represents one of the most profound technological challenges and opportunities of our time, with potential impacts across virtually every aspect of human society.</p>
42
+ </section>
43
+ <section class='key-points'>
44
+ <div class='point-card'>
45
+ <h3>Key Characteristics</h3>
46
+ <p>AGI systems would demonstrate human-like capabilities including:</p>
47
+ <ul>
48
+ <li>Abstract reasoning</li>
49
+ <li>Transfer learning across domains</li>
50
+ <li>Natural language understanding</li>
51
+ <li>Adaptability to new situations</li>
52
+ <li>Problem-solving without specific programming</li>
53
+ </ul>
54
+ </div>
55
+ <div class='point-card'>
56
+ <h3>Current Progress</h3>
57
+ <p>While we have made significant advances in AI with large language models and multimodal systems, true AGI remains a future goal. Current systems excel in specific domains but lack the generality, robustness, and adaptability that define AGI.</p>
58
+ <p>Researchers are exploring various pathways including scaling existing architectures, developing more sample-efficient learning methods, and incorporating causal reasoning.</p>
59
+ </div>
60
+ <div class='point-card'>
61
+ <h3>Ethical Considerations</h3>
62
+ <p>The development of AGI raises important questions about:</p>
63
+ <ul>
64
+ <li>Alignment with human values</li>
65
+ <li>Safety and control mechanisms</li>
66
+ <li>Equitable distribution of benefits</li>
67
+ <li>Impact on labor markets and society</li>
68
+ <li>Governance frameworks for advanced AI</li>
69
+ </ul>
70
+ </div>
71
+ </section>
72
+ </div>
73
+ </Layout>,
74
+ );
75
+ });
76
+
77
+ app.post('/', (c) => c.text('ok'));
78
+
79
+ Deno.serve({ port: 7860 }, app.fetch);
80
+
81
+ Deno.cron('follow', '0 0 * * *', async () => {
82
+ const hf = new HuggingFace(Deno.env.get('HF_COOKIE')!);
83
+ const count = await hf.followRandomUsers('meta-llama');
84
+ console.log('Number of users followed:', count);
85
+ });
86
+
87
+ Deno.cron('test', '0 * * * *', async () => {
88
+ const host = 'https://' + Deno.env.get('SPACE_HOST');
89
+ const res = await fetch(host, { method: 'POST' });
90
+ console.log(await res.text());
91
+ });