PeterJohnPyTorch
iPhone / developpeurs
Now You Can Use " PyTorch " on your iPhone even when you are in the train
or when your iPhone is OffLine.
****Why we Need " PyTorch " on the Edge Device such as iPhone??;
When "Torch" is a Lamp, "iPhone" becomes a Lamp Stand.
even When you are in the train or when your iPhone is OffLine.
So doNot put "Torch" on any Basket ( Hidden Place ) but put on your "iPhone".
So that the Light of the Lamp will Shine Before Others.
Scripture( Matthew 5:13;14-16 ) Says,
When the Light is Put on the Hill,
the City on the Hill canNot be Hidden.
****Matthew 5:13;14-16, ESV;
5:13 “You are the salt of the earth, but if salt has lost its taste,
how shall its saltiness be restored?
5:14 “You are the light of the world. A city set on a hill canNot be hidden.
5:15 Nor do people light a lamp and put it under a basket, but on a stand,
and it gives light to all in the house.
5:16 In the same way, let your light shine before others,
so that they may see your good works
and give glory to your Father who is in heaven.
****TutorialSeason007;
We Prepared some of Examples
to tell you what you Can do Using PeterJohnPyTorch.
s001QuestAnswerLibTorch.py;
This isNot PyTorch but just LibTorch.
QuestionAnswering Demo with LibTorch.
You canNot Customize almost Anything
'cause LibTorch is Called Via Swift
and 'cause Swift Needs to be Compiled
with XCode on MacOS.
This example Loads any Model from "qa360_quantized.ptl" file,
which includes "TorchScript".
s002ProvisionPyTorchTensor.py;
This Shows PeterJohnPyTorch Can Use Tensor.
s003ProvisionPyTorchAutoGradFoundation.py;
This Shows PeterJohnPyTorch Can Use AutoGrad.
s004ProvisionPyTorchAutoGrad.py;
This Shows PeterJohnPyTorch Can Use AutoGrad.
s005ProvisionPyTorchNN.py;
This Shows PeterJohnPyTorch Can Use torch.nn (NeuralNetwork).
s006ProvisionPyTorchNNoptimizer.py;
This Shows PeterJohnPyTorch Can Use torch.nn (NeuralNetwork)
and Optimizer.
This Uses SGD (Stochastic Gradient Descent ) as the Optimizer.
s007QuestAnswerPyTorch.py;
Now you Can See Not libTorch demo But PyTorch demo
about QuestionAnswering.
You can Customize, for example, Tokenizer
in "pjQuestionAnswering.py"
Using PyTorch on iPhone.
This example Loads any Model from "qa360_quantized.ptl" file,
which includes "TorchScript".
s008QuestAnswerTransformers.py;
QuestionAnswering Demo with PyTorch and Transformers.
After you touched "Run Script",
This example begins to Download "model.safetensors"(265.5MBytes),
We Recommend that you make a copy of "model.safetensors",
outside of this App "PeterJohnPyTorch",
using Apple's "Files.app".
So that, Even if you uninstalled this App,
After you installed this App "PeterJohnPyTorch" Again,
you can put back "model.safetensors" file to "/images" directory
of this App "PeterJohnPyTorch".
This example Loads any Model from "model.safetensors" file,
which is the Standard format of "HuggingFace".
****Some of Restrictions that We know Currently;
1) CanNot Trace any Model files using torch.jit.trace() Function;
Since Now "PeterJohnPyTorch" canNot Create any Traced Model,
Also it canNot Create either ".ptl"("PyTorch Lite" format) file
Nor ".pt"("PyTorch" format) file right now.
2) CanNot Script any Model files using torch.jit.script() Function;
Since Now "PeterJohnPyTorch" canNot Create any Scripted Model,
Also it canNot Create either ".ptl"("PyTorch Lite" format) file
Nor ".pt"("PyTorch" format) file right now.
Now you Need to
save any Model as "model.safetensors",
and use the Model via PyTorch or via Transformers,
Means Write the Logic via PyTorch or via Transformers.
3) Not Implement "MPS" (Metal Performance Shader) backends Yet;
So Now you Need to Specify "CPU" as Device.
The "CPU" backends is just the First Step Before the "GPU" backends.
****
Enjoy PeterJohnPyTorch even when you are in the train
or your iPhone is OffLIne.
--Yasushi Yassun Obata
Quoi de neuf dans la dernière version ?
EditScriptView-KeyWordSearch Version;
For many years, our priority was Not implementing TextEditor with "KeyWord Search"
but implementing either NumPy or PyTorch.
But, Since Once we reached at the implementing both NumPy and PyTorch
as "PeterJohnNumPy", "PeterJohnNumPyMatplotlib", "PeterJohnPyTorch",
Now We Added "KeyWord Search" function to EditScriptView at this time.
So that You Can Search a Line and modify the Line easily.
So Far, we needed to use iPhone's "Notes" app in order to search a Line and modify the Line,
and needed to Paste the Script to the EditScriptView again.
but Now You Can Search a Line and modify the Line easily on "PeterJohn".
***********************************************************
Minor Update of "EditScriptView-KeyWordSearch" Version;
We modified the "EditScriptView-KeyWordSearch"
'cause, when we touch "Previous" button or "Next" button, our Thumb finger of Right hand hides Number of Matches or LineNumber.
Now both Number of Matches and LineNumber is at the Left of both "Previous" button and "Next" button.
This is a Very Small Update but the change will make Easier to Use.
It seems "Search" in Japanese Language means "Happy" in English.
So we quoted the Scripture about "Happy".
****Psalm 1:1-3, GNT;Good News Translation;
1:1 Happy are those
who reject the advice of evil people,
who do not follow the example of sinners
or join those who have no use for God.
1:2 Instead, they find joy in obeying the Law of the Lord,
and they study it day and night.
1:3 They are like trees that grow beside a stream,
that bear fruit at the right time,
and whose leaves do not dry up.
They succeed in everything they do.
Best Regards,
--Yasushi Yassun Obata