Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,22 +49,7 @@ def transcribe_video(youtube_url: str, path: str) -> List[Document]:
|
|
49 |
return [Document(page_content=result[1], metadata=dict(page=1))]
|
50 |
|
51 |
|
52 |
-
|
53 |
-
topp: float = ToppSide, repetition_penalty: float = RepetitionpenaltySide) -> Any:
|
54 |
-
"""
|
55 |
-
Predict a response using a client.
|
56 |
-
"""
|
57 |
-
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
58 |
-
response = client.predict(
|
59 |
-
message,
|
60 |
-
system_prompt,
|
61 |
-
temperature,
|
62 |
-
max_new_tokens,
|
63 |
-
topp,
|
64 |
-
repetition_penalty,
|
65 |
-
api_name="/chat_1"
|
66 |
-
)
|
67 |
-
return response
|
68 |
|
69 |
|
70 |
class LlamaLLM(LLM):
|
@@ -119,7 +104,22 @@ def sidebar():
|
|
119 |
RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
|
120 |
|
121 |
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
sidebar()
|
125 |
initialize_session_state()
|
|
|
49 |
return [Document(page_content=result[1], metadata=dict(page=1))]
|
50 |
|
51 |
|
52 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
|
55 |
class LlamaLLM(LLM):
|
|
|
104 |
RepetitionpenaltySide = st.slider("Repetition penalty", min_value=0.0, max_value=2.0, value=1.2, step=0.05)
|
105 |
|
106 |
|
107 |
+
def predict(message: str, system_prompt: str = system_promptSide, temperature: float = temperatureSide, max_new_tokens: int = max_new_tokensSide,
|
108 |
+
topp: float = ToppSide, repetition_penalty: float = RepetitionpenaltySide) -> Any:
|
109 |
+
"""
|
110 |
+
Predict a response using a client.
|
111 |
+
"""
|
112 |
+
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
113 |
+
response = client.predict(
|
114 |
+
message,
|
115 |
+
system_prompt,
|
116 |
+
temperature,
|
117 |
+
max_new_tokens,
|
118 |
+
topp,
|
119 |
+
repetition_penalty,
|
120 |
+
api_name="/chat_1"
|
121 |
+
)
|
122 |
+
return response
|
123 |
|
124 |
sidebar()
|
125 |
initialize_session_state()
|