Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import time
|
| 3 |
from datetime import timedelta
|
|
@@ -35,6 +47,7 @@ def main():
|
|
| 35 |
elapsed_time, total_time = cpu_benchmark(cores)
|
| 36 |
result = f"Elapsed Time per Iteration: {elapsed_time:.6f} seconds\nTotal Time: {total_time:.6f} seconds"
|
| 37 |
st.success(result)
|
| 38 |
-
|
| 39 |
if __name__ == "__main__":
|
| 40 |
-
main()
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
|
| 3 |
+
def main():
|
| 4 |
+
messages = [
|
| 5 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
| 6 |
+
{"role": "user", "content": "Who are you?"},
|
| 7 |
+
]
|
| 8 |
+
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.3")
|
| 9 |
+
r=chatbot(messages)
|
| 10 |
+
print(r)
|
| 11 |
+
|
| 12 |
+
"""
|
| 13 |
import os
|
| 14 |
import time
|
| 15 |
from datetime import timedelta
|
|
|
|
| 47 |
elapsed_time, total_time = cpu_benchmark(cores)
|
| 48 |
result = f"Elapsed Time per Iteration: {elapsed_time:.6f} seconds\nTotal Time: {total_time:.6f} seconds"
|
| 49 |
st.success(result)
|
| 50 |
+
"""
|
| 51 |
if __name__ == "__main__":
|
| 52 |
+
main()
|
| 53 |
+
|