diff --git a/pages/oldtesting.tsx b/pages/oldtesting.tsx index b9f3b47..51758ad 100644 --- a/pages/oldtesting.tsx +++ b/pages/oldtesting.tsx @@ -1,54 +1,10 @@ import { useState } from "react"; import axios from 'axios'; import type { NextPage } from "next"; -import { HfInference } from '@huggingface/inference' -import { generateEmbeddings } from '../utils/generateEmbeddings' -import { getDocs } from '../utils/getDocs' -import { getArchives } from '../utils/getArchives' import styles from '../styles/home.module.css'; -const hf = new HfInference(process.env.HUGGING_FACE) - const OldTesting: NextPage = () => { - const [info, setInfo] = useState(null); const [loading, setLoading] = useState(false); - const [inputValue, setInputValue] = useState(""); - - async function getInfo() { - setLoading(true); - try { - const response = await hf.textGeneration({ - model: 'gpt2', - inputs: inputValue - }); - setInfo(response.generated_text); - console.log(response); - } catch (error) { - // Handle error if the request fails - console.error("Failed to fetch assets:", error); - } finally { - setLoading(false); - } - } - - async function testOpenAi() { - //const info = await generateEmbeddings(); - axios.post('/api/generate-embeddings') - .then((response) => { - // Handle the response data - console.log(response.data); - }) - .catch((error) => { - // Handle any errors - console.error('An error occurred:', error); - }); - console.log("Testing", info) - } - - async function fetchArchives() { - const info = await getArchives(); - console.log("Testing", info) - } async function fetchDocs() { let archives = {}; @@ -69,31 +25,12 @@ const OldTesting: NextPage = () => { {loading && (

Home

- setInputValue(e.target.value)} - /> - -

{info ? info : ""}

-
-
-
-
- -
)} );