Illia56 commited on
Commit
d92b221
1 Parent(s): e4e82a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -15
app.py CHANGED
@@ -90,21 +90,36 @@ def transcribe_video(youtube_url: str, path: str) -> List[Document]:
90
  result = client.predict(youtube_url, "translate", True, fn_index=7)
91
  return [Document(page_content=result[1], metadata=dict(page=1))]
92
 
93
- def predict(message: str, system_prompt: str = '', temperature: float = 0.7, max_new_tokens: int = 1024,
94
- topp: float = 0.5, repetition_penalty: float = 1.2) -> Any:
95
- """
96
- Predict a response using a client.
97
- """
98
- client = Client("https://osanseviero-mistral-super-fast.hf.space/")
99
- response = client.predict(
100
- message,
101
- temperature,
102
- max_new_tokens,
103
- topp,
104
- repetition_penalty,
105
- api_name="/chat"
106
- )
107
- return response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
  PATH = os.path.join(os.path.expanduser("~"), "Data")
110
 
 
90
  result = client.predict(youtube_url, "translate", True, fn_index=7)
91
  return [Document(page_content=result[1], metadata=dict(page=1))]
92
 
93
+ # def predict(message: str, system_prompt: str = '', temperature: float = 0.7, max_new_tokens: int = 1024,
94
+ # topp: float = 0.5, repetition_penalty: float = 1.2) -> Any:
95
+ # """
96
+ # Predict a response using a client.
97
+ # """
98
+ # client = Client("https://osanseviero-mistral-super-fast.hf.space/")
99
+ # response = client.predict(
100
+ # message,
101
+ # temperature,
102
+ # max_new_tokens,
103
+ # topp,
104
+ # repetition_penalty,
105
+ # api_name="/chat"
106
+ # )
107
+ # return response
108
+
109
+ def predict(input, path = None):
110
+ client = Client("https://roboflow-gemini.hf.space/--replicas/bkd57/")
111
+ result = client.predict(
112
+ None,
113
+ [path],
114
+ 0.4,
115
+ 2048,
116
+ "",
117
+ 32,
118
+ 1,
119
+ [[input,None]],
120
+ api_name="/bot"
121
+ )
122
+ return result[0][1]
123
 
124
  PATH = os.path.join(os.path.expanduser("~"), "Data")
125