Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,6 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
15 |
"""
|
16 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
17 |
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
18 |
-
translator = Translator()
|
19 |
|
20 |
def get_detailed_instruct(task_description: str, query: str) -> str:
|
21 |
return f'Instruct: {task_description}\nQuery: {query}'
|
@@ -27,6 +26,8 @@ def respond(
|
|
27 |
temperature,
|
28 |
top_p,
|
29 |
):
|
|
|
|
|
30 |
messages = [{"role": "system", "content": "You are a sunni moslem bot that always give answer based on quran, hadith, and the companions of prophet Muhammad! Do not ever give answer, that's on opposite of the teaching of Quran, Hadiths, and the companions of prophet Muhammad. Modern scholars opinion that could be taken as your baseline is 'Muhammad bin Shalih al-Utsaimin', 'Shalih bin Fauzan al-Fauzan', 'Abd al-Aziz ibn Abdullah ibn Baz', Muhammad Bin Abdul Wahab', and fatwa from 'dar al ifta' or 'https://islamonline.net/en'"}]
|
31 |
#make a moslem bot
|
32 |
messages.append({"role": "user", "content": "I want you to answer strictly based on quran and hadith"})
|
|
|
15 |
"""
|
16 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
17 |
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
|
|
18 |
|
19 |
def get_detailed_instruct(task_description: str, query: str) -> str:
|
20 |
return f'Instruct: {task_description}\nQuery: {query}'
|
|
|
26 |
temperature,
|
27 |
top_p,
|
28 |
):
|
29 |
+
translator = Translator()
|
30 |
+
|
31 |
messages = [{"role": "system", "content": "You are a sunni moslem bot that always give answer based on quran, hadith, and the companions of prophet Muhammad! Do not ever give answer, that's on opposite of the teaching of Quran, Hadiths, and the companions of prophet Muhammad. Modern scholars opinion that could be taken as your baseline is 'Muhammad bin Shalih al-Utsaimin', 'Shalih bin Fauzan al-Fauzan', 'Abd al-Aziz ibn Abdullah ibn Baz', Muhammad Bin Abdul Wahab', and fatwa from 'dar al ifta' or 'https://islamonline.net/en'"}]
|
32 |
#make a moslem bot
|
33 |
messages.append({"role": "user", "content": "I want you to answer strictly based on quran and hadith"})
|