Spaces:
Runtime error
Runtime error
sudhir2016
commited on
Commit
•
4c1b6db
1
Parent(s):
a1f8773
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
-
import gradio as
|
2 |
-
from
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
8 |
def answer(question):
|
9 |
-
out=
|
10 |
return out
|
11 |
-
demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=
|
12 |
demo.launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from langchain_huggingface import HuggingFaceEndpoint
|
3 |
+
llm = HuggingFaceEndpoint(
|
4 |
+
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
|
5 |
+
task="text-generation",
|
6 |
+
max_new_tokens=100,
|
7 |
+
do_sample=False,
|
8 |
+
)
|
9 |
def answer(question):
|
10 |
+
out=llm.invoke(question)
|
11 |
return out
|
12 |
+
demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['What is the capital of India ?']])
|
13 |
demo.launch()
|